cancel
Showing results for 
Search instead for 
Did you mean: 

Timer: Input capture filter, many ways how to configure the same behavior

MVele.1
Associate II

Hello,

I am trying to configure TIM9 input capture to detect high-low transition on a signal connected to TIM9_CH1 pin. There is a requirement to filter out short negative pulses < 480 ns. The timer is running at 100 MHz.

The configuration is straighforward, however there are multiple possible settings, e.g.

  1. CKD = 0, IC1F = 8
  2. CKD = 1, IC1F = 6,
  3. CKD = 2 , IC1F = 4

Every configuration leads to a sampling frequency of 12.5 MHz with 6 samples needed to detect transition. However the sampling frequency is created in different parts, tDTS or divided CK_INT.

Is there any difference or advantage that e.g. configuration 1 is preffered than 2?

Best

Martin

3 REPLIES 3

> Is there any difference or advantage that e.g. configuration 1 is preffered than 2?

If the state transition is noisy, sampling more often results in detecting shorter peaks, i.e. the output of filter will change later, but there's higher chance that the input signal has been already steadied.

Whether your application benefits from this or not, is upon you to decide.

JW

MVele.1
Associate II

Hi Jan,

thank you for answer, however that's not exactly what I was asking. The sampling frequency is always 12.5 MHz (+ 6 samples needed to confirm transition) but there are several ways how to configure the sampling frequency.

E.g. the figure below comes from General-purpose timer cookbook. To achieve the same sampling you can configure either CKD or ETF in this case, the CKD is input for ETF. Mathematically it is obvious; the TCK_INT = 100 MHz, CKD divider = 1 , ETF divider = 2 -> TSAMPLING = 50 MHz or CKD divider = 2 , ETF divider = 1 -> TSAMPLING = 50 MHz. The question is if there is some side effect or it does not matter which way of configuration is selected.

0693W000001pl5JQAQ.png

Martin

Ah I see, sorry I misunderstood your question.

Besides the ETR and TIx filters, DTS is used also for deadtime generation in the Advanced timers. There, you might want primarily to set CKD to lower end for short deadtimes, or to higher end for longer deadtimes, and then adjust the filters' settings accordingly.

This aspect is not obvious in non-Advanced timers such as TIM9, but all the timers are in fact generated from a common "root" IP, only by disabling features. That they have separated chapters in RM only inflates the RM and creates confusion (although it would be challenging to merge all the timer chapters into one in a concise way, I admit).

Nonetheless, the selection of the filters settings available, is somewhat arbitrary.

JW