cancel
Showing results for 
Search instead for 
Did you mean: 

input capture

Hafsh.2
Associate II

Hi

I launched a capture and sensitized the interrupt to both edges.

I want to recognize each edge when intraoperating.

I mean, to find out which edge was intraverted?

I use micro stm32f407vgt

6 REPLIES 6

There is no indication, which edge was captured.

If you need this, it's better to use two separate channels (CH1+CH2, or CH3+CH4), set them to input from the same physical pin, and set one to capture on rising edge and the other to capture on falling edge.

JW

TDK
Guru

You can read the current value of the pin to make an educated guess at the last edge that triggered it. But otherwise, as JW mentions, there's no way to know.

If you feel a post has answered your question, please click "Accept as Solution".

Thanks, but I do not want to involve another IO

I can not do by guessing

The only issue here is if multiple triggers happen so fast the IRQ can't be called for each one.
If you feel a post has answered your question, please click "Accept as Solution".

You mean another pin? This does not involve another pin - for one channel you select TIMx_CCMRx.CCxS to 0b01 i.e. using "it's own" pin; and for the other 0b10, and in that way you capture signal on the same physical pin.

JW