2013-08-12 11:35 AM
Hi,
I want to sample a fast timer (125ns) when an EXTI interrupt occurs, before the interrupt is handled. Later when the interrupt is handled i want to be able to compare the actual value of the same timer and measure the interrupt latency.How do i setup the capture of the timer after the exti is fired?Should I use DMA?I don't need code, only the general concept...Thanks to all helper on this forum :) #interrupt #stm32 #timer #exti2013-08-12 12:21 PM
Use a timer in input capture mode, it will latch the timebase into the channel register. ie CCR2 = CNT, then read CNT in the interrupt handler for the pin configured in EXTI mode.
2013-08-12 01:26 PM
Yes thanks.
Then i don't need to use the exti interrupt, i could just use the interrupt of the input capture...2013-08-12 01:27 PM
Yes thanks.
Then i don't need to use the exti interrupt, i could just use the interrupt of the input capture...2013-08-12 01:34 PM
Would likely work either way. Not sure if the filtering/synchronization would change the latency.
2013-08-12 01:38 PM
Another question since you're there :)
Can a pin, says B6 be configured as an input for both an input capture and an exti interrupt at the same time?2013-08-12 01:47 PM
On which part?
I haven't tried it myself, but given the way such structures can be built I'm apt to believe the output from the input pad's schmitt trigger is available to the EXTI mux regardless of what other peripheral it's attached too.