ADS8681: Interfacing ADS8681 with PIC32

Part Number: ADS8681


I interfaced ADS8681 with PIC32MX processor but it's not working.

READ_HWORD is not returning proper register value. it never worked. I get 32-bit reading. As per datasheet, I should get 16 bit reading followed by 0's. 

Even WRITE_HWORD is also not working. It seemed like it worked one time.  I set RANGE_SEL[3:0] to 1001b (2.5*VREF) once.

When I send all 0's I get ADC conversion value as response and that was working as per the selection I made to RANGE_SEL[3:0] bits. 

But now even as of sudden, though I gave 1.6v as input analog voltage, I get 6.2v (156.25 * 16-bit reading).

Please help me in resolving the issue.

I am attaching the code file. Please check and let me know if I'm missing anything.ads8681.c



4 Replies

  • Hi Srinivasarao,

    Thanks for your query on TI E2E forum.

    After running these commands:

    ->  spi_write_word_reg(RANGE_SEL_REG,RANGE_2_5_VREF|INTREF_EN)

    -->  DWORD data = WRITE_HWORD(reg,val);

    Can you please check if the "data" is   <11010_000> <0001_0100> <00000000> <00001001>? also can you capture the timing on SDI to ADC with SCLK and /CS together by using a scope?

    After these two commands, use your register read instruction to check the content of this RANGE_SEL_REG register, this will let you know if your programming is successful:

    -> vSPIONSave = spi_read_word_reg(RANGE_SEL_REG)

    -->   DWORD dwAddress = READ_HWORD(reg);

    Please check if the "dwAddress" is <11001_000> <0001_0100> <00000000> <00000000>? also can you capture the timing on SDI and SDO on ADC by using a scope? Please notice that If a valid READ_HWORD command is issued in frame F, the output data word for frame (F+1) contains 16-bit register data, so you will be able to see the register data in next (F+1) frame, and one more frame is needed.



  • In reply to Dale Li:

    Hi Dale,

    Thank you for the response.

    I checked the 32-bit command data that is sent to ADS8681 and it is correct as per the datasheet.

    Please find the attached word document which got screenshots of timing diagrams for both Write and Read register of RANGE_SEL.

    Please check and let me know if anything is wrong.




  • In reply to Srinivasarao P:

    Hi Srinivas,

    I will get back to you soon, thanks.

    Best regards


  • In reply to Dale Li:

    Hi Srinivas,

    Your data in SDI timing to ADC is correct, can you please let me know what code you got on SDO in next frame after reading RANGE_SEL_REG register?

    Can you please let me know your test detail for 1.6V?

    • The conversion code for 1.6V DC input before writing internal register (default configuration after power up)
    • The conversion code for 1.6V DC input after writing internal RANGE_SEL_REG register (select 2.5VxVref range with 1001b for Range_SEL[3:0])
    • Is there any front-end RC filter on ADC input? your schematic will be very helpful.


    Best regards