This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS8361EVM to Arduino

Other Parts Discussed in Thread: ADS8361EVM, ADS8361

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

  • Hello Stefan,

    We do not have sample code available.

    To clarify your question: the A0 pin is ignored in mode III.

    My recommendation would be to double check the CONVST RD, CS, and serial data lines with an oscilloscope or logic analyzer to make sure your code translates into waveforms equivalent to those in figure 12 of the ADS8361 datasheet.

    Hope this helps.

    Best regards,

    Jose