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.

ADS1231: Interface ADS1231 with 2 wire SPI

Part Number: ADS1231

Hello,

I want to interface ADS1231 with 2-wire SPI (CLK, MISO). SPI is from microcontroller. DRDY/DOUT pin should be detected low and then we have to send clock to ADS1231 to get data in DRDY/DOUT pin. As microcontroller pin is configured as SPI peripheral pin MISO, I am facing difficulty in detecting DRDY/DOUT low signal. 

Can we configure ADS1231 using 2-wire SPI? 

Thank You.

Ajay

  • Hello Ajay,

    Yes, you can use a standard SPI port, but you will need to separately monitor the DOUT pin for an output high-to-low transition.  You can do this by reconfiguring the MCU pin from a SPI MISO to a standard input pin, and poll for a low signal.  Once DOUT reads low, you can then reconfigure the pin as the SPI MISO pin.  You can also use a separate IO pin on the MCU and connect to the MISO pin and directly poll this pin for a LOW level.

    Please also note that in order to poll the DOUT pin, you will need to send a 25th SCLK to force the DOUT pin high after data has been read.  Since you will be using a standard SPI port, you can clock a total of 32b over SPI; the ADS1231 will ignore the 26th clock through the 32nd clocks.  Please refer to Figure 20 in the datasheet for details.

    Regards,
    Keith Nicholas
    Precision ADC Applications

  • Hello Kelth,

    Thank you for prompt reply. As per your suggestion "You can do this by re configuring the MCU pin from a SPI MISO to a standard input pin, and poll for a low signal.  Once DOUT reads low, you can then reconfigure the pin as the SPI MISO pin.". SPI MISO pin is externally pulled high. Will it impact ADS1231 DOUT pin when SPI MISO pin is reconfigured as standard input pin (due to external pull up). 

    Regards,

    Ajay

  • Hello Ajay,

    The DRDY/DOUT pin is a push-pull output and an external pull-up resistor can be added.  The pull-up resistor should be connected to the same supply voltage that also powers the DVDD supply on the ADS1231.  In addition, the pull-up should 10kOhm or greater to reduce loading effects on the DRDY/DOUT pin.

    Regards,
    Keith

  • Hello Kelth,

    Thanks for support.

  • Hello Keith,

    Is it good programming practice to keep on re-configuring SPI MISO pin and standard input pin.

    Yes, you can use a standard SPI port, but you will need to separately monitor the DOUT pin for an output high-to-low transition.  You can do this by reconfiguring the MCU pin from a SPI MISO to a standard input pin, and poll for a low signal.  Once DOUT reads low, you can then reconfigure the pin as the SPI MISO pin.  You can also use a separate IO pin on the MCU and connect to the MISO pin and directly poll this pin for a LOW level.

    Out of the two methods which method will you suggest?

    Thank You.

    Ajay 

  • Hello Ajay,

    I would suggest using a separate IO pin, as this will result in less code and a more straight-forward approach.

    One other option, which many customers will do since this is a slow device, is to simply bit-bang the SCLK, and read back the /DRDY/DOUT pin level without using a SPI module on the processor.  In this case, you can send 25 SCLK's, and then poll the status of the /DRDY/DOUT pin, and when it goes low, you are ready to read the next conversion result.

    Regards,
    Keith