cancel
Showing results for 
Search instead for 
Did you mean: 

Start timer on GPIO input High and change another GPIO

sreyas40
Senior

I'm trying to start a timer when input GPIO becomes high (on its rising edge), at the same time i want to pull another GPIO to low. This is time critical.

I'm using an external adc which will output a ready signal, at that time i want to pull CS pin to low and wait for a delay (tREAD), at the end of timer , want to pull the CS back high.

 Which is the best way to do, as i need the least latency.

I'm using Nucleo H723ZG

11 REPLIES 11

I have selected the maximum frequency to get the max sampling rate. 

If i use NSS in hardware mode , if i call HAL_SPI_Recieve does the CS gets pulled low and high after reception automatically

gbm
Principal

For fixed, deterministic sampling rate, the conversion must be triggered by microcontroller's timer output. Knowing the ADC parameters, maybe you don't even need the ready signal from it. Maybe an interrupt from another channel of the same timer could be used to start the data transfer.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice