cancel
Showing results for 
Search instead for 
Did you mean: 

TIMER2 INPUT CAPTURE

sooraj
Associate
Posted on February 05, 2014 at 13:42

Hi,

Kit using : STM32Discovery Board(STM32F100 controller)

I have implemented the input capture mechanism for Timer15 channel 1. In which I set triggering for both falling and rising edge.

Now I am trying to port the application to Timer2 channel 2. But the problem what I  facing is, in Timer2 I can't find any option to trigger both edge. Only one edge triggering is possible. So is there any mechanism to enable both edge triggering for Timer2.

Please help me to come out of the situation.....

Thanks

Sooraj Mannangal

#input-capture #stm32discovery
2 REPLIES 2
Posted on February 05, 2014 at 15:42

There are so many errors in the timers' documentation(*) (including AN4013), that I'd simply try first to write to both CC2P and CC2N of TIM2_CCER,  regardless of what the UM says.

If this fails, you always can use simultaneously capture 1 and capture 2, having capture 2 trigger on one edge and capture 1 on the other, by ''redirecting'' (and inverting) the input from CH2 to capture 1 (by setting TIM2_CCMR1.CC1S to 10).

JW

(*) For example, for said TIM2_CCER.CC1P, RM0041 rev.4 ch.13.4.9 p.325 has to say ''This bit selects whether IC1 or IC1 is used for trigger or capture operations''.

I am tired of repeating: it's a shame.

sooraj
Associate
Posted on February 13, 2014 at 09:27

Thanks, second solution works for me.