Skip to main content
chulinhtre
Associate
November 1, 2016
Question

STM32F042F6- TSSOP20- Where is the TIMER 2 Channel 1?

  • November 1, 2016
  • 2 replies
  • 699 views
Posted on November 01, 2016 at 17:28

Dear all experts,

I am programming Incremental Encoder Reading project for 2 encoders.

I intend to use TIM2, and TIM3 for Encoder Config with 4X Reading. I check the datasheet (DM00105814) for MCU Pin configuration.

For TIM3, I can see TIM3-CH1, and TIM3_CH2 are Pin PA6, PA7

For TIM2, I cannot find TIM2-CH1, instead of that, I see 2 pin PA0 and PA5 can config to same function TIM2-CH1-ETR.

As subject, Could any one can help me to find out TIM2-CH1?

Thank you in advance.

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    November 1, 2016
    Posted on November 01, 2016 at 17:39

    TIM2-CH1-ETR is TIM2-CH1 and TIM2-ETR, as ETR is an input only it doesn't conflict, and would need to be configured inside the timer to be used.

    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    chulinhtre
    Associate
    November 1, 2016
    Posted on November 01, 2016 at 18:08

    Thank you very much Clive1,

    I solved the problem by :

    /* (3) Select AF2 on PA5 in AFRL for TIM2_CH1 */

    GPIOA

    ->

    AFR

    [

    0

    ] |=

    0x02

    << (

    5

    *

    4

    );

    /* (3) */