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

Re: ADIS16488 SPI connection using the mbed microcontroller LPC1768

$
0
0

Hi NevadaMark,

 

Thanks for your notes here. 

In terms of your first message, Yes, I did try to read the PROD_ID register, from which I expected decimal 16480 on the terminal screen. However, I did not use scope probe to measure the pulses, it kept outputting 65535. The code below is quite simple actually,

#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;

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

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

    while(1) {

        wait_ms(500);

        cs=0;

        imu.write(0x8000);

        x=imu.write(0x7E00);      //RW bit high. (MB bit high(datasheet)). plus address

        cs=1;

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

        }

    }

 

1. Yes, I think so. I thought it might be better to set up the sample rate before starting the transmission.

 

2. The "write" is the mbed API pattern, which basically writes to the SPI slave and return the response. You may refer to the link for more details: http://mbed.org/handbook/SPI

 

3. I do not try other code at moment. One interesting thing I noticed is if I plugged out/in the power supply of the IMU, the values would change and shortly, it went back to the values I mentioned before.

 

I did not measure the current and will do it right away..

 

Thanks,

RobinUofC


Viewing all articles
Browse latest Browse all 22625

Trending Articles



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