Fairly simple question but I couldn't find any instructions on this. I'm using an STM32G070
I'm interfacing with an ADS1231 which uses DOUT / ~DRDY on the same pin, and I'm wondering if there is a way to use the interrupt pin as an input as well. Essentially what I want to do:
- Wait for a falling edge on the DOUT/~DRDY pin (currently configured as EXTI)
[Inside of the ISR:]
- Disable interrupts on the pin
- Use the pin as an input
- Send out the 24 clock signals, reading the DOUT/~DRDY pin after each clock falling edge
- Turn the pin back into an interrupt
- Exit and wait again
I found an interesting answer in another thread, using the same part (https://electronics.stackexchange.com/a/339742/281491)
I would do it completely other way.
Set SPI2 MISO pin as GPIO input. Set the EXTI (falling edge) interrupt on this pin
In the EXTI interrupt - Disable EXTI, change this pin to the MISO AF, and initiate 3 byte DMA transaction (send 3 dummy bytes as you need to generate clock for the ADS).
In the DMA transfer complete interrupt change pin to the GPIO Input. Enable EXTI
Steps 2 & 3 will automatically repeat on every conversion.
Can anyone elaborate on how I would go about doing the bolded parts, or any other solutions?
Thanks