I am attempting to use the SPI2 peripheral on the STM32L471RG microcontroller in order to communicate with the ADS1234 and wanted to run my thoughts past some of you more experienced firmware developers!
Right now I am using the internal clock of the ADC, so I mainly need to focus on the DRDY/DOUT and SCLK pins. I'm going to have an initialize function that configures the other ADC pins.
The reference manual of the STM32L talks about the different modes of SPI that are possible, which leads to my question(s):
- I am planning on using simplex receive with SPI2 - does this mode sound reasonable based on the ADS1234 interface waveforms?
- The ADS1234 is 24-bit and the STM32L only goes up to 16-bits in the buffer. My thinking is to configure it for 12-bits and do two transfers, although I'm not sure if this will conflict with anything?
- Since using the DRDY function is not completely a part of the SPI protocol, I'm wondering how to have this trigger a data transfer. If the DRDY/DOUT pin state goes from high to low (indicating data is ready) should I configure for an interrupt-on-change (IOC) event and then go into completing a transfer?
Below is the data retrieval waveform of the ADS1234.
Thank you for any help. I'm mainly concerned about the logistics of everything.