AnsweredAssumed Answered

STM32F334 Tim2 Input Capture Long Interrupt Latency

Question asked by cicerom on Aug 6, 2015
Latest reply on Aug 10, 2015 by cicerom
Hi,

Was wondering if anyone has any help for me on this.

Device: STM32F334R8T6 (on the nucleo)
Frequency: 64MHz (double checked outputting the sysclock on MCO), 2 flash wait states
IDE+compiler: SW4STM32 (free eclipse based)
Std Library: V1.1.1 (4 April 2014) STM32F30x Standard Peripherals Library Drivers

I am reading a single wire bitstream with a max speed of 250kpbs (4us a bit).  Using tim2 input capture channel 1 & 2 to read the rising and falling edge times, but finding the interrupt latency was too long (5us!).

Eventually in order to debug, I 'copied' the data stream in the interrupt on another output pin, so when it entered the rising edge interrupt I'd output a high on a different output pin, and when falling output a low - nothing else.  The interrupt latency from the input change and seeing it on the output pin from the interrupt was around 5us!  So it'd miss bits (because they're 4us) and it would be stuck servicing the interrupt  all the time.

Is this kind of latency normal?  I was expecting maybe maximum 1us or so.  12cycles @ 64Mhz = 187ns.

Has anyone seen this kind of latency? 

Outcomes