AnsweredAssumed Answered

AD7147 unresponsive

Question asked by JeanFrankot on May 28, 2013
Latest reply on Jul 8, 2013 by spratt

Hello,

  I'm trying to read and write registers of this CDC model with a Arduino Uno. I sent the signal clock and the commands however I don't receive any answer from the device. All the time the output (SDO) is in high level and it doesn't change.

I was trying this code to read the Device ID:

//-------------------------

//COMMON - GND

//D13 - SCK

//D12 - MISO

//D11 - MOSI

//D7  - CS

//D6  - DIO

 

#include <SPI.h>

const int CS = 7;

const int DR = 6;

 

void setup ()

{

  Serial.begin(9600);

  SPI.begin();

  pinMode(CS, OUTPUT);

  pinMode(DR, INPUT); 

  SPI.setBitOrder(MSBFIRST);

  SPI.setDataMode(SPI_MODE3);

  SPI.setClockDivider(SPI_CLOCK_DIV32); // [operating at 500KHz]

  digitalWrite(CS, HIGH);

  delay(1000);       

}

 

void loop()

{

  digitalWrite(CS, LOW);

  SPI.transfer (0xE4);

  SPI.transfer (0x17);

 

  delayMicroseconds(5);

 

  int resultH = SPI.transfer (0x00);

  int resultL = SPI.transfer (0x00);

  unsigned int device_ID = (( resultH ) << 8 ) | ( resultL );

  Serial.println("Device ID:");

  Serial.println(device_ID);

  digitalWrite(CS,HIGH);

}

//-------------------------

 

I don't know what could be wrong. I verified level shifters work.

I tried different ways to send the command and address and had no response. (I Always receive: "Device ID: 65535", it means high level all the time).

I attach some images of the circuit and signals from oscilloscope.

 

Thanks in advance for your help.

 

Gian.

 

Ref.

http://arduino.cc/en/Reference/SPI

Attachments

Outcomes