AnsweredAssumed Answered

SPI Interfacing between ADIS16210 and mbed LPC1768

Question asked by Oscar_Espejo on Jul 29, 2014
Latest reply on Aug 20, 2014 by NevadaMark

I'm tryng to connect an ADIS16210 to a mbed LPC1768 development board. I search fore some tutorials to document me, so I programm this code to get the information about (at least) one inclination sensor:

 

#include "mbed.h"

#define SERIAL_BAUD_RATE    9600

 

Serial pc(USBTX, USBRX); // tx, rx

SPI spi(p5, p6, p7); // mosi, miso, sclk

DigitalOut cs(p8);

DigitalOut led(LED1);

 

int main() {

    spi.format(16,3);

    spi.frequency(500000);

    cs = 1;

    led = 1;

    int temp;

while (1) {

        cs = 0;

        led=0;  

        spi.write(0x0c00);

        wait_ms(500);

        temp = spi.write(0x00); //*1

        cs = 1;

        led = 1;

        pc.printf("Register Data: %d\r\n", temp); // 

        wait(1); // wait a sec.

        }

}

 

This is the last code I used, because after that I try about 10 codes without the 500ms delay for example with the same result that is the result is the same lat number that I send, dor example if I replace the line  "*1" by temp = spi.write(0xC0); the result is 0xC0 and so on...

 

Then, I use an scope to analyze the signals in MISO and MOSI and found someting extrange, in the next image is the signal in CLK for reference:

clk.jpg

 

 

Then I save the signal of MISO unplugged to the sensor (that is remarkable that is in fact the 0x0c00 number):

MISO_UP.jpg

And then Connected to the sensor:

MISO_PL.jpg

Now, the signal in MOSI is the same of MOSI when is connected... that have two voltaje falls, I search abot the need to use pull up resistors but in no place tells something about so I don't take the risk.

 

The other issue was thatr the datasheet shows the ADIS connected to an 3.3V power source but when I connect the sensor to the mbed 3.3V output the DIO1 pin don't respond (that is the sensor is not refreshing the data) so I connected to the 5V pin and then the DIO1 pin responds but the signal is the same with the same issues..

 

I spend all my ideas and resources and honestly I don't know how to proceed with this.

 

Thanks in advance for the help!!!

Outcomes