Hi Ian.
I have purchased for my experiments board EVAL-AD7177-2.
It has a AD7177-2 and voltage reference ADR445 and all that is needed for the work.
I'm a beginner in digital electronics and not sure what it was doing well.
I read the datasheet for AD7177-2 and to Arduino and it looks as if I combine everything as shown in the picture.
Datasheet on the Arduino, says that you need to use a PIN 10-13 they are for SPI. I use the same pin?
What do I do next after skech will fill in Arduino?
#include <SPI.h>
#define ADCMODE 0x01
#define CONTINUOUS_READ 0x8000
#define DATA 0x04
#define READ (0 << 6)
#define WRITE (1 << 6)
void setup(){
SPI.begin();
//setup the device for continuous reading
// take the SS pin low to select the chip:
digitalWrite(10, LOW);
//send a write command to set the ADC into continuous read mode
//need to write this mode to the ADCMODE register
SPI.transfer(WRITE | ADCMODE);
SPI.transfer(CONTINUOUS_READ);
// take the SS pin high to de-select the chip:
digitalWrite(10, HIGH);
}
void loop(){
//select the device for reading
digitalWrite(10, LOW);
//transfer the 4 bytes
uint8_t buffer[4] = {0};
//read from the DATA register
SPI.transfer(READ | DATA);
//get the data into the buffer
SPI.transfer(buffer,4);
//now need to combine the bytes together - NOTE this is for MSB
unsigned long int value = buffer[0] << 24 | buffer[1] << 16 | buffer[2] << 8 | buffer[3];
digitalWrite(10, HIGH);
//need to determine what to set RATE to to get sufficient readings - see page 18 of datasheet
delay(5);
}
Attachments: