I am attempting to interface to an SPI measurement IC and read data from it.
This makes use of a "data ready" feature, which lets the microcontroller know that a measurement is complete and data is ready.
Typically on similar devices, I would find the "data ready" pin to be an additional pin from the IC which I can use as a GPIO interrupt on the MCU to signal to start reading on SPI. When this pin goes low, I need to start reading on SPI. I prefer not to do this in a polling fashion.
However, in this case, "data ready" and "data out" (MISO) is shared on the same pin (see timing diagram below). How could I handle this? Some ideas I have are:
- Connect this pin to two pins on the MCU - have one as a GPIO interrupt, the other as MISO
- Change the function of the pin during runtime, start it as GPIO interrupt, then configure the pin as SPI MISO, and repeat (seems unorthodox to do this)
Are there MCU SPI peripherals that handle this feature (that is, start a read when MISO changes from HIGH to LOW)?
For reference, the IC is AD7192 and I am working with the STM32L4 series MCU.