Question
STM32F4Discovery counter problem,
Posted on July 28, 2013 at 22:22
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 ;