Hello, I am using the evaluation board of the ads1298 and I'm trying to make the spi communication between the board and an arduino due.
As a start, I'm trying to read the ID but the DRDY is always 1.
In the start of the communication I send a RESET command, then a SDATAC and then I'm trying to read the ID.
The clock frequency I use is 1MHz.
Here is the code
#include "SPI.h" int CS=10; int RESET=0x06; int RDATAC=0x10; int SDATAC=0x11; int START=4; int data; void setup() { SPI.begin(CS); SPI.setDataMode(CS, SPI_MODE1); SPI.setBitOrder(CS, MSBFIRST); SPI.setClockDivider(CS, 84); } void loop() { digitalWrite(START,HIGH); SPI.transfer(CS,RESET); SPI.transfer(CS,SDATAC); while(1){ SPI.transfer(CS,B00100000); SPI.transfer(CS,1); delayMicroseconds(2); data=SPI.transfer(CS,0); } }
Here I attached the plots from a logic analyzer.
I am very confused as I do what the datasheet says.