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.

using arduino zero with ADS8688IDBTR

Dears, 

 

I am using a ADS8688IDBTR with Arduino zero it works with the code below, but every time i upload the code the channel number changes for each channel  :

 

 

#include "SPI.h"

int CS=A3;
float ch =0;

void setup() {

pinMode(CS, OUTPUT);
digitalWrite(CS, 1);
SPI.begin();
SPI.setDataMode(SPI_MODE1);
SPI.setBitOrder(MSBFIRST);
SerialUSB.begin(9600);
Serial.begin(9600);
digitalWrite(CS, 1);

}

void loop() {

for(int i =0 ; i<8 ;i++){
digitalWrite(CS, 0);
SPI.transfer16(0x00); // start Ch0 sampling
ch=SPI.transfer16(0x00); // get Ch0 conversion
digitalWrite(CS, 1);

ch=mapfloat(ch,32770,65535,0,10.15);
SerialUSB.print("CH");
SerialUSB.print(i) ;
SerialUSB.print(" = ") ;

SerialUSB.println(ch) ;

delay(10);

}
delay(1000);

}

float mapfloat(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}

 

 

I tried to use this lib but it wont work ::https://github.com/siteswapjuggler/ADS8688a

 

can any body help in this case and if there is any c++ code fit with this IC and Arduino zero  

 

i want to know also the registers command order to initialize  it before read channels 

  • Hi

    Can you please clarify "the channel number changes for each channel"? is it a mismatch between the conversion code and the channel number? If that is the case, is the situation (code vs. channel#) different when running the code every time? Please share a few oscilloscope plots of the /CS, SCLK, SDI and SDO to verify the timing on the interface. 

    We do not have an example code for a specific microcontroller. Below is a general C code example, please check Source Files:

    http://www.ti.com/tool/ADS8688SW-LINUX

    There is no specific order to write registers. 

    Thanks and best regards,

    Dale

  • Hi ,

    I did not get any response from you so I will close this thread. You can open a new thread if the issue is not solved or you have any further question. Thanks.

    Regards,

    Dale