I'm puzzled with interfacing the ADS8361EVM (evaluation board for ADC ADS8361) with an arduino (Mega) via SPI.
Is there a sample code (alternatively in C or any other language) for reading the channels in any mode?
Basic problems are that the arduino runs on 16 MHz with 8bit SPI libraries while the AD3861 only accepts 10 MHz clock signals on its 21 bit sequence.
Still, I think the following lines should do the trick, which they don't.
Also basic bit banging didn't get me anywhere.
#include <SPI.h>
const int slaveSelectPin = 53;
void setup() {
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE2));
digitalWrite(slaveSelectPin,LOW);
}
void loop() {
unsigned int readValue;
float outValue;
readValue = readAdc();
}
unsigned int readAdc(){
unsigned int readValue;
byte byte0;
byte0 = SPI.transfer(B00000111);
readValue = SPI.transfer(0xFF);
readValue = (readValue << 8) | SPI.transfer(0);
return readValue;
}
is it correct that A0 is ignored in mode III, or should it be triggered initially after CONVST, as shown in Figure 12?
Thanks,
Stefan