2013-10-17 03:23 AM
Hi all,
the TimeBase example in stm32f3discovery_fw reports the next code in main.c file:CCR1_Val = 40961;TIM_TimeBaseStructure.TIM_Period = 65535;TIMx->ARR = TIM_TimeBaseInitStruct->TIM_Period ;What I really don't understand is the comment reported below: CC1 update rate = TIM3 counter clock / CCR1_Val = 1757.77 Hz==> Toggling frequency = 878.88 HzCan someone help me?Thanks and regards #stm32f3discovery_fw-stm32-timer2013-10-17 04:36 AM
If it's the example I think it is, the 65535 is the maximal setting for the timer, the CCR1 value is advanced at each CC1 interrupt (see stm32f4xx_it.c), allowing each timer to generate multiple frequencies.
Toggling doubles the period, and thus halves the frequency.2013-10-18 12:07 AM
Thank you Clive1