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.

ADS1216: ADC is always sending me one more byte than the requested

Genius 9880 points
Part Number: ADS1216

Hi Team, 

Customer is always getting more byte than expected when using RREG function. Below is the details.

"

1. I'm using the RREG function. Asking to get 1 byte of information but the ADC is always sending me one more byte than the requested. I mean, if I ask for 1 byte, it sends me 2, if I ask for 2 it sends me 3..
I'm sending via SPI first 0x10 and then 0x00. Technically it only has to give me back one byte, reading the SETUP info and sending it to me

The information is correct, because I'm writing in in 0x0C and it gives me 0x8C, but I suppose that the 8 because the 3 bits I can't modify

when using RREG funtion I'm sending this :
0x10 -> To read the SETUP register
0x00 -> To read only one register
and then I read

Do I have to send another 0 so the ADC knows I'm going to start reading?

2. Another question, there are 3 bits in SETUP register that are factory programmed , bit 7 bit 6 and bit 5 - how are they programmed ? 100 ?

I'm using an arduino as the master and a 4.91MHz clock in Xin


"

  • Hi Maynard,

    The ADS1216 has a device pin marked POL which sets the polarity of the SCLK.  This pin should be set low.  Next the SPI interface should be set to what is usually referred to as Mode 1 polarity where SCLK dwells low and where the data changes on the rising edge of SCLK and remains stable on the falling edge.  So the customer needs to change the phase of the SPI interface.

    It is not clear if the communication length is setup as bytes or as words (16-bit word for example).  I'm guessing that it is 16-bit word length where each transmission is 16 bits.  I would suggest changing the communication to byte length communication.  In the end the micro is initiating the SCLKs and not the ADS1216.

    Also, CS must stay low throughout the entire communication transaction.  If the CS toggles between bytes, the communication will cancel.  And there is a 40 tosc delay required between the sending of the command and the reading of the data.

    As to question 2, the communication is incorrect so I cannot verify what is actually happening.  The read only bits are device ID bits in the SETUP register.  I do not know the current values and these could change without notice.

    Best regards,

    Bob B

  • Hi Bob,

    I just received response from customer. Below is the details.

    "POL pin has to be set low, but in datasheet it says in can be set LOW or HIGH, furthermore, I only have problems whit the RREG funtion, the WREG Works perfectly so it doesnt seem to be a POL pin problem.

    I’m using a 8bit word length transmission not 16. CS is set low during the entire communication."

    Regards,
    Maynard

  • Hi Maynard,

    For the POL set low, the communication should be set to SPI mode 1 and not mode 0.  The customer may think that the communication is correct but it is not.  The PHAse setting for SPI should be set so that the data changes on the rising edge and holds steady on the falling edge.

    There must also be a 40 tosc delay between the command and capture of data.  The command is 2 bytes and the data is 1 byte.  However the micro is issuing 4 bytes.  That is a firmware issue and not an ADS1216 issue.  The communication needs to be corrected to read/write to the device correctly.  The customer may think that the WREG is working perfectly, but the communication is incorrect and needs to change on the correct phase of the SCLK.

    Best regards,

    Bob B