Skip to main content
mail+st
Associate
May 2, 2009
Question

Timers in quadrature decoder mode

  • May 2, 2009
  • 2 replies
  • 615 views
Posted on May 02, 2009 at 12:28

Timers in quadrature decoder mode

    This topic has been closed for replies.

    2 replies

    mail+st
    mail+stAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:10

    Hi!

    I want to use an STM32F103ZE to control a 4 axis CNC machine (with DC servos and quadrature encoders).

    As I understand, I can use TIM2..5 to simultaneously capture the 4 encoder positions, but I wonder which pins to use. Would this be ok? :

    TIM2_CH1 Enc. 1 Phase A

    TIM2_CH2 Enc. 1 Phase B

    TIM3_CH1 Enc. 2 Phase A

    TIM3_CH2 Enc. 2 Phase B

    TIM4_CH1 Enc. 3 Phase A

    TIM4_CH2 Enc. 3 Phase B

    TIM5_CH1 Enc. 4 Phase A

    TIM5_CH2 Enc. 4 Phase B

    The Reference Manual is a little bit unclear here. Can the other timer channels 3/4 also be used for quadrature capture?! Or do I have to use TIMx_CH1/2?

    What do the signals TI3FP3, TI3FP4, TI4FP3 and TI4FP4 on page 270 do?!

    I can't find any other reference to them in the manual..

    Also, the firmware library seems to lack an example program for quadrature capture.

    Greetings from Germany,

    Thomas Kindler

    mail+st
    mail+stAuthor
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:10

    Hmm, after reading the data sheet, it seems that there's no pin for TIM2_CH1..

    Is there a way to use CH3 / CH4 instead?!