AnsweredAssumed Answered

STM32F4Discovery counter problem,

Question asked by mal.alex on Jul 28, 2013
Latest reply on Jul 29, 2013 by mal.alex
I have problem with timer - I want use one as simply counter of external impulses.
Now I have (with too many unnecessary settings), but counter not work. I want use eg. TIM1, then I should use GPIO setting as AF for TIM1_CH1?

gpio_pin_cfg(GPIOA, 8, GPIO_AF1_IN_FLOATING);
RCC->APB2ENR |= RCC_APB2ENR_TIM1EN;
TIM1->CCER |= TIM_CCER_CC1E;
TIM1->CCR1 |= 2;
TIM1->SMCR |= TIM_SMCR_ECE;
TIM1->SMCR |= 7;
TIM1->CR2 |= TIM_CR2_TI1S;
TIM1->CCMR1 |= 1;
TIM1->CR1 |= TIM_CR1_CEN ;

Outcomes