SPI Connection with the ADIS16201

Hey guys,

First of all I want to say that I am not a good programmer.
The ADIS16201 is a dual-axis digital inclinometer and I want to get the momentary X and Y angle of the Sensor. (Register Information is attached).

Firstly, i only get zeros back as information. (Maybe a problem with the ChipSelect)

Secondly the angle is resulated in 12 Bits (per axis), but i don’t know how to get this information on one variable.

I would really appreciate some help,
Thanks Guys.

#include <SPI.h>

#define DATAOUT 11           //MOSI   
#define DATAIN  12           //MISO
#define SPICLOCK  13         //sck
#define SLAVESELECT 10       //ss

void setup() {
  pinMode(DATAOUT, OUTPUT);                  // SPI Out/Inputs
  pinMode(DATAIN, INPUT);


  SPI.setClockDivider(SPI_CLOCK_DIV32);      // 16MHz/32=500kHz
  digitalWrite(SLAVESELECT, LOW);


void loop() {

byte val[2];

  val[1] = SPI.transfer(0x0D);
  val[2] = SPI.transfer(0x0C);

  Serial.println (val[1], DEC);
  Serial.println (val[2], DEC);

Why don’t you just use a library for that chip (OK, a very similar one)?

I don’t think that this Library works for it, but i will give it a try, thanks

I just don't get it to work. Could somebody show me an example code to get some data from this sensor through SPI?

Maybe if I see it I get it.

Have you tried the library? What do you get? Post the code you used!