2011-04-18 08:52 AM
stm32l151: TIMx input capture to count input pulses (input filter configuration)
2011-05-17 05:32 AM
Hi filippo,
The filter on input capture channel isn't a divider. As it is named, it is a filter. In my understanding, if you set the filter @ 7 (TIM_ICFilter = 0x7) there is 7 sampling on internal clock (I think MSI at your case) to make the decision if the input channel is set at high level or low level. I suggest to use TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV8; It should suit you. Otherwise let me know . Ciao, MCU Lüfter2011-05-17 05:32 AM
Hello Lüfter,
in my understanding if I set
TIM_ICInitStructure.TIM_ICPrescaler = TIM_ICPSC_DIV8;
I get 1 input capture event every 8 input pulses; this isn't what I want.
What I want is what you wrote:
''if you set the filter @ 7 (TIM_ICFilter = 0x7) there is 7 sampling on internal clock > (I think MSI at your case) to make the decision if the input channel is set at high > level or low level.''
where I supposed that setting TIMx->PSC with the following
TIM_PrescalerConfig(TIM4, 0xffff, TIM_PSCReloadMode_Update);
the filter would check 7 samples at fDTS=fMSI / 0xffff frequency.
Isn't that the behaviour?
Thanks and best regards,
Fil