Problems with FTM input capture filtering
1.FTM1 is in input capture mode
2.FTIM1 input clk = 80MHz/128 = 625KHz
3.FTM1.SC.FLTPS = 15 (Divide by 16, filter clk = 625KHz/16 ≈ 40KHz)
4.FTM1.FILTER.CH0FVAL = 15
So,
Filtering time = 4 rising edges of FTM input clock+(1 + 4 × CHnFVAL[3:0]) rising edges of FTM filter clock
= 4/625KHz + (1 + 4*15)/40KHz = 6.4us + 1525us ≈ 1530us
If the input PWM signal frequency is 10kHz and the duty cycle is 50%, then the high level time is 50us;
If the filtering time is 1.53ms, the pulse should not be detected;But I can still detect the pulse;I don't know where I went wrong;
Solved! Go to Solution.
Hi,
I took some tests and it works, the calculation seems to be correct, but the FTM filter clock is derived from the FTM System clock not from the FTM function clock (RM rev12.1, Table 27-9. Peripheral module clocking).
Regards,
Daniel
i have a same confusion like him,the input capture filter do not work.
Hi,
I took some tests and it works, the calculation seems to be correct, but the FTM filter clock is derived from the FTM System clock not from the FTM function clock (RM rev12.1, Table 27-9. Peripheral module clocking).
Regards,
Daniel
hi,thanks for your reply.Your reply has solved my problem.
"the FTM filter clock is derived from the FTM System clock not from the FTM function clock " help me a lot.
For me, the correct formula for filtering time would look something like this :
filtering clk= FTM sys clk/16 = 80MHz/16 = 5MHz
FTM input clk = 80MHz/128 = 625KHz
filtering time = 4 rising edges of FTM input clock+(1 + 4 × CHnFVAL[3:0]) rising edges of FTM filter clock
= 4/625KHz + (1 + 4*15)/5MHz = 18.6us
Therefore, it can detect pulses with a pulse width of 50us;
Thank you again!
hello,i'm struggle in the same problem and can i consult it with you