cancel
Showing results for 
Search instead for 
Did you mean: 

How to use TIM1 [Encoder interface mode]

lzyos
Associate II
Posted on November 05, 2012 at 09:03

I want capture signal like

0690X00000604zHQAQ.png

I want capture how many times yellow signal is high on the falling edge of blue signal in 1 second 

my code is 

TIM1_TimeBaseInit(0, TIM1_CounterMode_Up, 50000, 0);

TIM1_EncoderInterfaceConfig(TIM1_EncoderMode_TI1,

TIM1_ICPolarity_Rising,TIM1_ICPolarity_Falling);

TIM1_Cmd(ENABLE);

but the counter always 0 , after 1 second 

Is there any guide for use TIM1 encoder interface mode.

#stm8-tim1-encoder-interface-mode
0 REPLIES 0