Quantcast
Channel: EngineerZone: Message List
Viewing all articles
Browse latest Browse all 36216

Re: ADIS16488 SPI connection using the mbed microcontroller LPC1768

$
0
0

Hi NevadaMark,

 

Sorry for the late response.  I only have a 2-channel scope at moment and I captured the graphs for the CS and SCLK signal on the screen, and then I showed the DIN and DOUT signal on the scope as you will see on the picture I attached.

 

photo.JPG

 

From the top to the bottom are CS, SCLK, MOSI, MISO. It looks like the output signal(MISO) is correct. However, I still have only 0 output on the tera term terminal.

Here below is the code I used:

#include "mbed.h"

#include "stdio.h"

SPI imu(p5, p6, p7);        //set up spi interface on pins 5,6,7

DigitalOut cs(p8);      //use pin 8 as chip select

Serial pc(USBTX, USBRX);        //USB interface to host terminal

int x;

int main(){

    cs=1;

     wait_ms(500);

    imu.format(16,3);       //16 bit data, mode 3

    imu.frequency(1000000);     //1MHz clock rate

    while(1) {

        cs=0;

        imu.write(0x8000);

        x=imu.write(0x7E00);     

        cs=1;

        pc.printf("x=%d\n\t", x);

        }

    }

 

Best,

RobinUofC


Viewing all articles
Browse latest Browse all 36216

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>