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.

ADS8883: SPI communication with 16 bit Frames

Part Number: ADS8883

Hi,

Since many ARM based controllers (eg: STM32L4 series) allow setting the SPI Data Size (DS) from any value between 4 and 16 bits, how do we transfer 18 bit values from the ADC to the microcontroller?

More specifically, If my STM32 makes the CONVST / nCS pin HIGH after 16 clock cycles, what happens to the remaining 2 bits in the 18-bit value stored by the ADC (ADS8883)? Will it get overwritten with a new value, because CONVST being made HIGH leads to the start of the next conversion cycle?

Or will it be preserved, so that the microcontroller can initiate another transaction (by making nCS LOW) and get the remaining bits? (Or break it into two frames, each of 9 bits)?

Thanks in advance.

  • Hello Mrutyunjaya,

    When using an MCU with a SPI port, you can control the /CS (DIN in 4-wire) using a GPIO pin.  First, pull /CS low.  Next, either transfer 2x 16b words, or 3x 8b words, to create a single SPI frame.  After the data has been transferred, pull /CS high to complete the frame.  If you do not need all 18b, you can transfer the first 16b and the remaining 2b will be lost when the next conversion result is available.

    I do not suggest sending 2 SPI frames by pulling /CS high and low again.  It is possible the data is preserved, but the device was not designed to operate in this mode.

    Regards,
    Keith Nicholas
    Precision ADC Applications

  • Hi Keith,

    Thanks for the input. 

    I''ve been able to read the data with Two 16bit word transfers. Apparently, the 'TI Mode' that ARM provides for SPI does not necessarily work for all TI ADCs. Also, the 14 LSBs in my 2nd word (that I need to ignore, as this is an 18 bit transfer), are mostly FFs, but not always. I guess this will be sorted once i tie DOUT to VDD through a Pull-up resistor.

    Thanks for the help.

    Rgds,

    MJ

  • Hello MJ,

    I am glad to hear that you have this working. Most TI ADCs follow the original SPI standard, including the ADS8883.

    Yes, after the LSB has been transmitted, the DOUT line goes Hi-Z, and you will read random data for the last 14LSBs.  As you mention, if you pull DOUT to VDD through a pull-up, then you should always read FF for the 14LSBs.

    Regards,
    Keith