AnsweredAssumed Answered

Can I interrupt on an external pin being low for a certain period of time?

Question asked by Wood.Robert on Jul 14, 2014
Latest reply on Jul 15, 2014 by Wood.Robert
Folks,

Having started at the data sheet for over half a day I don't think I can do this, but feel it should be possible, so am hoping someone can clarify!

I'm using an STM32F107 and I would like to connect an external pin to the processor and measure if it stays low for a certain period of time. If it does, it should interrupt the processor. The timers are incredibly complex (and the manual does not make them easy to grasp), I think they almost do what I want, but not quite. 

For example, reset capture mode resets a timer when the input goes high, but it does not stop it when the input is high. If it did, it would count when the signal was low, reset and stay off when high. If I programmed the correct compare value into one of the CCR registers, if the counter got to a certain value, before my input went high, I could interrupt and know the external line had been low for the requisite time. However, as far as I can see, the counter continues when the input is high, What I need is for the external signal to reset the counter AND stop it counting at the same time. I could happily connect the same signal to two pins if that would work.

Can I actually do what I need to do please? And if so, how?!

Many thanks! :~)

Outcomes