cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to interface to external ADCs like TI's ADS1232?

Antypas.Peter
Senior

There is a plethora of 24-bit ADCs similar to TI's ADS1232, which output data using a "DREADY/DOUT" pin and expect the micro to supply a variable number of clock pulses depending on the operation (read / calibrate / write, etc).

These are typically low bandwidth, high ENOB devices for medical and other precision applications.

What is the best way to interface to these from STM32 silicon? Is it worth trying to cajole the SPI bus to conform to this behavior, or should I just forget about it and bit-bang the whole thing? Searching the forums didn't reveal much.

Thanks.

4 REPLIES 4
Pavel A.
Evangelist III

They should have application notes that explain how to use this thing.

-- pa

S.Ma
Principal

Both, choose the SPI capable pins to connect to the ADS and start with bit bang. SPI has programmable bit length. Did a quick test with ADS1299 read/write registers with bit band, look ok, now going to read measurements...

berendi
Principal

Depending on the STM32 series, some have programmable bit length, some don't. Even if the bit length is programmable (L4/G4/F7/H7), only STM32H7 supports 25 bits, and none of them would output 24.5 clocks for the sleep mode on its own.

Bit-banging should of course work, but it's still possible to let SPI do most of the work.

The simplest way is to connect DRDY#/DOUT to SPI MISO and SCLK(ADS1213) to SPI SCK(STM32). Monitor MISO for a falling edge (GPIO and EXTI input is still available while the pin is connected to the SPI peripheral), let SPI input 3 bytes in master mode, then set the SPI SCK pin as digital output to send the 25th or 26th pulse. If possible, use a pin for SCK which can be remapped to a timer channel, so that sending the last pulse could be automated with a timer.

Antypas.Peter
Senior

Thanks for the comprehensive response. For the ADS1232 I don't need half bits, so this should work. The only time I need to send the 26th clock cycle is for calibration during startup, so I can afford to bit bang this (and block). I didn't realize I could process EXTI without reassigning the pin. I'll give it a shot.