AnsweredAssumed Answered

Timer 2 capture mode for period measurement - STM32F407

Question asked by K_hebacher.Michael on Feb 16, 2017
Latest reply on Feb 21, 2017 by waclawek.jan

// Configure timer 2
    RCC_APB1ENR.TIM2EN = 1;
    TIM2_CR1.CEN = 0;
    TIM2_CR2.TI1S = 0;
    TIM2_PSC = ENCODER_TIM_PSC;
    TIM2_ARR = ENCODER_TIM_RELOAD;
    TIM2_CR1 |= 0x10;

// Configure input capture
    TIM2_CCMR1_Input |= 0x01;
    TIM2_CCER.CC1P = 0;
    TIM2_CCER.CC1NP = 0;
    TIM2_CCER.CC1E = 1;
    TIM2_DIER.CC1IE = 1;

 

Question: how do I define input PC1 as TI1 for timer 2

 

thanks!

Outcomes