cancel
Showing results for 
Search instead for 
Did you mean: 

the doubt in M4-Discovery input capture library

0owarrioro0
Associate II
Posted on April 19, 2012 at 19:43

like this: I don't know why selecting opposite polarity !

/* Select the Opposite Input Polarity */

  if (TIM_ICInitStruct->TIM_ICPolarity == TIM_ICPolarity_Rising)

  {

    icoppositepolarity = TIM_ICPolarity_Falling;

  }

  else

  {

    icoppositepolarity = TIM_ICPolarity_Rising;

  }

wait for help .

thanks in advance!

#great?thanks-! #wait-for-you--clive1-!-!-! #thanks-for-your-help-!-! #great?thanks-! #great?thanks-! #the-doubt-in-m4-discovery-input #haha #wait-for-you #xie-xie-ni-clivel1-!!-thanks-!
12 REPLIES 12
Posted on April 21, 2012 at 13:39

The channel pairing is 1&2, and 3&4 and feed the input capture signals (IC1, IC2, IC3, IC4) to the ''Compare'' latches. The PSC and CNT are your time base (sample frequency), you want this ticking as fast as possible, you are latching this count into your registers. CCR2 is going to get ticks you can use to determine the period (ie from rising edge A to rising edge B). I haven't thought too much about the duty, but I'd guess it's looking at the opposite phase of the clock, so you can probably look at the falling edge (CH1) with respect to the next rising edge (CH2).

The timers are complex, I don't claim to fully understand them, the wiring diagrams are the best documentation to start with, but you will need to experiment, and work with the examples.

0690X00000605U0QAI.png

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
0owarrioro0
Associate II
Posted on April 22, 2012 at 10:07

thanks for your replay .

With your help and I have a detail understand .

But what's the joint gate ''XOR'' which combine the CH1/CH2/CH3 used for in the figure 65 .

Cesar cfg
Associate II
Posted on February 13, 2013 at 09:42

Hi,

I have a problem in capturing 3 PWM signals using Timer3 in the STM32F0 discovery.

so if you have any idea or any procedure to resolve my problem.

thanks.