Post Go back to editing

ADIS 16460 SPI communication

Hi,

Need help with the SPI communication with the IMU ADIS16460. We are sending the IMU 16bit bytes and giving a time delay of 40 micro sec before reading again 16bit bytes in our code. But we are getting garbage values form the IMU.

For eg for checking the SPI communication on Page 11 of data sheet there is DIN = 0x5600 which should give a
DOUT= 0x404C(in number 16460). We are not receiving that. The DOUT received is of random values like 65535 which is 1111 1111 1111 1111. This DOUT values changes randomly when we switch off and switch on the IMU.

SCLK = 1MHZ

CODE used is as follwed just for debugging the SPI communication part:

#include <SPI.h>

int CS = 2;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(CS,OUTPUT);
  digitalWrite(CS,HIGH);

  Serial.println("Wait for 5 secs");
 
  SPI.beginTransaction(SPISettings(1000000,MSBFIRST,SPI_MODE3));

  SPI.begin();
 
  Serial.println("Waited 5 Secs");
 
  digitalWrite(CS,LOW);
  SPI.transfer16(0x5600);
  digitalWrite(CS,HIGH);
 
  delayMicroseconds(40);
 
  digitalWrite(CS,LOW);
  int data2 = SPI.transfer16(0x00);
  digitalWrite(CS,HIGH);

//  Serial.println(data1);
  Serial.println(data2);
}
void loop() {
  // put your main code here, to run repeatedly:

}