Arduino and Bridge Transducer (AD7730)

Hi,
I have been trying to get the AD7730 and Arduino (ATMEGA2560) to talk to each other using SPI. Wired the AD7730 up on a bread board, connected it to Arduino and then set up the SPI (Mode 0: clock idle in LOW and new bits at LOW->HIGH clock transitions) on Arduino.

SPI.transfer(BYTE) doesn't seem to show any effect though. After sending the command byte to for example ask to read from the status register the RDY signal never goes LOW (signalling a finished reading/writing operation).

When trying to read from the AD7730 data register, what byte do I have to pass to SPI.transfer [data = SPI.transfer(address byte)] ? I didn't find any documentation about what address byte to use (0x00, 0xFF, ...).

For sending multi-byte data, I did send the high byte first and then the lower bytes (0x1234 --> 0x12 then 0x34) in individual SPI.transfer() commands seeing that SPI.transfer() only handles bytes. Is that the right order

Anyone here who has some experience with working with the AD7730? Seems like a great chip to interface with load cells, but I am rather stuck at the moment and would welcome any help.
Many thanks!


VDD: 5V signal from L7805
GND: currently shared ground for analog and digital - just want to get system running

AD7730 pin | connected to

1 | Arduino p52 (SPI SCK)
2 | currently 4MHz CMOS signal generated by another Arduino (also tried 4MHz crystal)
3 | open (also tried 4 MHz crystal)
4 | GND
5 | VDD
6 | Arduino p40
7 | OPEN
8 | GND
9 | VDD
10 | Load cell Out+
11 | Load cell Out-
12 | OPEN
13 | OPEN
14 | VDD and load cell In+
15 | GND and load cell In-
16 | OPEN
17 | OPEN
18 | VDD
19 | Arduino p53 (SPI SS)
20 | Arduino p41
21 | Arduino p50 (SPI MISO)
22 | Arduino p51 (SPI MOSI)
23 | VDD
24 | GND

Arduino code

#define RESET 40
#define RDY 41
#define CSEL 53

// commands from AD7730 datasheet
const int COMM_WRITE_MODE = 0x02;
const int COMM_READ_STATUS = 0x10;
const int MODE_FULL_SCALE_CALIB_0_10MV_1 = 0xB1;
const int MODE_FULL_SCALE_CALIB_0_10MV_2 = 0x80;
const int MODE_ZERO_SCALE_CALIB_0_10MV_1 = 0x91;
const int MODE_ZERO_SCALE_CALIB_0_10MV_2 = 0x80;
const int READ_BYTE = 0xFF; //right byte??
int del = 100; // delay time

void setup() {
Serial.begin(9600);
pinMode(RDY,INPUT);
pinMode(RESET,OUTPUT);
pinMode(CSEL,OUTPUT);
pinMode(MISO,INPUT);
pinMode(MOSI,OUTPUT);
digitalWrite(RESET,HIGH);
digitalWrite(CSEL,LOW);

SPI.begin();
SPI.setDataMode(SPI_MODE0);
SPI.setBitOrder(MSBFIRST);
SPI.setClockDivider(SPI_CLOCK_DIV16);
delay(del);
}

void loop() {

digitalWrite(RESET,LOW); // reset AD7730
delay(del);
digitalWrite(RESET,HIGH);
delay(del);

SPI.transfer(COMM_READ_STATUS); // Next Operation: Write to MODE register
aux = SPI.transfer(READ_BYTE);
while(digitalRead(RDY) != LOW) {} // wait for RDY signal from AD7730
Serial.println(aux,BIN);

SPI.transfer(COMM_WRITE_MODE); // Next Operation: Write to MODE register
SPI.transfer(MODE_FULL_SCALE_CALIB_0_10MV_1); // Initial Internal Full-Scale Calibration, 0-10mV input range
SPI.transfer(MODE_FULL_SCALE_CALIB_0_10MV_2);
while(digitalRead(RDY) != LOW) {}

SPI.transfer(COMM_WRITE_MODE); // Next Operation: Write to MODE register
SPI.transfer(MODE_ZERO_SCALE_CALIB_0_10MV_1); // Initial Internal Full-Scale Calibration, 0-10mV input range
SPI.transfer(MODE_ZERO_SCALE_CALIB_0_10MV_2);
while(digitalRead(RDY) != LOW) {}

}

For SPI to work you have to manually pull the SS line LOW before the first byte you send and set it HIGH again after the last byte for that command is sent or received.

digitalWrite(53, LOW);
 SPI.transfer(COMM_READ_STATUS); // Next Operation: Write to MODE register
  aux = SPI.transfer(READ_BYTE);
  while(digitalRead(RDY) != LOW) {} // wait for RDY signal from AD7730
  Serial.println(aux,BIN);
digitalWrite(53, HIGH);

I'm doing a project with the same integrated, I would spend the entire code in arduino and integrated connection diagram? :slight_smile:

Those still looking for information check out my post here Arduino and the AD7730 - Science and Measurement - Arduino Forum