Hi Everyone
I have bought ADS1292R and i want to communicate with this chip using Arduino Uno as part of my project,
I used the connection diagram from data sheet using Uni Polar power supply, AVDD 3v, and DVDD 1.8v.
For starter i just want to read any register from the chip, so i know that i am communicating with the chip and than i will proceed further.
I made a simple code to read the first register with address 0x00, as this is the read only register. But i am not getting the correct value from the register.
And just to let everyone know, i have just started with programming, so kindly tell me a simple solution thanks.
Here is my code
#include <SPI.h>
int ADS1292_DRDY_PIN = 6;
int ADS1292_CS_PIN = 7;
int ADS1292_START_PIN = 5;
int ADS1292_PWDN_PIN = 4;
void setup()
{
Serial.begin(9600);
pinMode(ADS1292_DRDY_PIN, INPUT); //6
pinMode(ADS1292_CS_PIN, OUTPUT); //7
pinMode(ADS1292_START_PIN, OUTPUT); //5
pinMode(ADS1292_PWDN_PIN, OUTPUT); //4
delay(10);
digitalWrite(ADS1292_PWDN_PIN, HIGH);
delay(10);
digitalWrite(ADS1292_PWDN_PIN, LOW);
delay(10);
digitalWrite(ADS1292_PWDN_PIN, HIGH);
delay(10);
delay(100);
digitalWrite(ADS1292_START_PIN, LOW);
delay(20);
digitalWrite(ADS1292_START_PIN, HIGH);
delay(20);
digitalWrite(ADS1292_START_PIN, LOW);
delay(50);
SPI.begin();
SPI.beginTransaction(SPISettings(1000000,MSBFIRST,SPI_MODE1));
}
void loop()
{
//// SPI Commands as mentioned in the data sheet
char reset = SPI.transfer(0b00000110);
delay(1);
char wakeup = SPI.transfer(0b00000010);
delay(1);
char rdat = SPI.transfer(0b00010010);
delay(1);
char readreg = SPI.transfer(0b00100000); // read register command
delay(1);
char regad = SPI.transfer(0b00000000); // register address
delay(1);
char Regval = SPI.transfer(0b00000000); // Dummy data
delay(1);
Serial.print(Regval,BIN);
Serial.print("\n");
}