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.

ADS8686S: Sample code

Part Number: ADS8686S

Hello, 

I am looking for sample code for ADS8686S with MCU. It will be very helpful to develop application with this ADC with sample code reference. 

Thank you 

  • Hi Neel,

    Unfortunately we do not have an example code for this ADC,  however please let me know if you have any question about this ADC.

    Regards,

    Dale

  • Dale can you show which command I should send to ADC to read the value. I see the addresses are provided but I am not getting success. Let's say I want to read register Range_A1 which has address 0x4. I am sending 2byte data over SPI. what should I send? data = 0x4000?

  • Hi Neel,

    I apologized for the late response because I took time off in the past days.

    The following table from the ADS8686S datasheet has shown the correct data you should send to the ADC to read a register. To read RANGE_A1 register which has 0x4 address,  you should send 0x0800 data (D15 = 0 and D11 D10 D9 = 100) to ADS8686S ADC according to the following 7-12 table:

    Once you send this correct command to ADS8686S ADC, you should be able to get a correct response from the ADC, the default value 0x8FF is expected to be seen in next frame, see the timing below:

    Regards,

    Dale

  • Hello Sir, 

    I received the correct message from the ADC. What command should I send to read channel 1,2,3...?

    I think I might be sending the right command but would like to confirm. Checked my COVST and BUSY signals are right. 

    I don't want to do stack sequence. just normal operation. 



  • Hi Neel,

    There is no command to read conversion data. You only need to send SCLK clocks to the ADC so that the ADC can shift out the data, this is usually done by send out 0s on SDI so your microcontroller can output clocks on SCLK.

    See the details in the session 7.5.3.1 Reading Conversion Results and also the timing in figure 7-29 and 7-30 in ADS8686S datasheet:

    Regards,

    Dale

  • Hello, 

    SO I should select the channel in CHANNEL_SEL register, set range in RANGE_XX register and send 0x0000 on the SPI to read selected channel? 

  • Hi Neel,

    Correct. Both CHANNEL_SEL and RANGE_XX registers have default configurations, you can change them if needed. Also, you need to reset ADS8686S by sending reset pulse to the ADC after it is powered up. Check the datasheet for the details.

    Regards,

    Dale

  • Hello Dale, 

    When I put range +5 to -5 and connect channel to ground(both legs). Way I get 0000 sometimes   and FFFF sometimes

  • can you let me know how to convert the data to voltage ? range is +5 to -5. I saw the section says 2's complement but I wan to know the explanation 

  • Hi Neel,

    If you look at the transfer function curve in ADS8686S datasheet as shown in the following figure, you can see the ideal code for midscale input (0V for bipolar input ranges) is 0x0000, the code for -FS is 0x8000 and the code for +FS is 0x7FFFF, so the code from this ADC is Twos Complement Binary Format. 0xFFFF is the code close to 0x0000 and the difference is only one code, this is a correct code and response from ADS8686S ADC.

    The easy way for you to convert between code and voltage is to download and use TI's free tool: Analog Engineer Calculator, see the following screenshot:

    Regards,

    Dale