2013-12-11 05:33 AM
Hi community,
i've got a question dependig on the configuration of the input capture filter of the stm32f407. I found the following lines in the datasheet (depending TIMx_CCMR1 register): =============================================================== Bits 7:4IC1F: Input capture 1 filter This bit-field defines the frequency used to sampleTI1 input and the length of the digital filter applied to TI1. The digital filter is made of an event counter in which N events are needed to validate a transition on the output: 0000: No filter, sampling is done at fDTS1000: fSAMPLING=fDTS/8, N=6 0001: fSAMPLING=fCK_INT, N=21001: fSAMPLING=fDTS/8, N=8 0010: fSAMPLING=fCK_INT, N=41010: fSAMPLING=fDTS/16, N=5 0011: fSAMPLING=fCK_INT, N=81011: fSAMPLING=fDTS/16, N=6 0100: fSAMPLING=fDTS/2, N=61100: fSAMPLING=fDTS/16, N=8 0101: fSAMPLING=fDTS/2, N=81101: fSAMPLING=fDTS/32, N=5 0110: fSAMPLING=fDTS/4, N=61110: fSAMPLING=fDTS/32, N=6 0111: fSAMPLING=fDTS/4, N=81111: fSAMPLING=fDTS/32, N=8 Note: In current silicon revision, fDTSis replaced in the formula by CK_INT when ICxF[3:0]= 1, 2 or 3 =============================================================== My settings are: f_clk_int = 84MHz, fDTS = 0.25*f_clk_int, maximum allowed input frequency = 5KHz I want to configure the filter in that way, that a input signal must at least have a puls width of 100�s. If I have a sample frequency(fDTS) of 21MHz, I would need a filter counter value (N) of 2100. But, where can I set this counter value? I think my main problem is that I don't understand the datasheet in that case. I would be happy if anyone could help me. Simon #input-capture-filter2013-12-11 06:41 AM
Hi
You are right the timer is immensely complicated if you are using it for more than just up/down & overflow counting. What mode are you using the timer in InputCapture or OutputCompare?2013-12-11 08:59 AM
Your presentation of the table is distracting.
0000: No filter, sampling is done at fDTS
0001: fSAMPLING=***_INT, N=2
0010: fSAMPLING=***_INT, N=4
0011: fSAMPLING=***_INT, N=8
0100: fSAMPLING=fDTS/2, N=6
0101: fSAMPLING=fDTS/2, N=8
0110: fSAMPLING=fDTS/4, N=6
0111: fSAMPLING=fDTS/4, N=8
1000: fSAMPLING=fDTS/8, N=6
1001: fSAMPLING=fDTS/8, N=8
1010: fSAMPLING=fDTS/16, N=5
1011: fSAMPLING=fDTS/16, N=6
1100: fSAMPLING=fDTS/16, N=8
1101: fSAMPLING=fDTS/32, N=5
1110: fSAMPLING=fDTS/32, N=6
1111: fSAMPLING=fDTS/32, N=8
I think you'll have to do the analysis of the pulse width by measuring it's beginning and trailing edges.