2013-08-28 03:14 AM
Hi,
I'm studying the timers on STM32F100 using a STM32VLDISCOVERY board.Per example:TIM_TimeBaseStructure.
TIM_Prescaler
= SystemCoreClock/1000
-1
;TIM_TimeBaseStructure.
TIM_Period
=1
;Will set the count frequency to 500Hz.If I configure an OC like this:
//configure channel TIM2 CH2
TIM_OCStructInit(&TIM_OCInitStructure);
TIM_OCInitStructure.
TIM_OCMode
=TIM_OCMode_Toggle
;TIM_OCInitStructure.
TIM_OutputState
=TIM_OutputState_Enable
;TIM_OC2Init(
TIM2
, &TIM_OCInitStructure);It will create an output clock at 250Hz on TIM2CH2. Now what I don't understand.Why can't be the TIM_Period = 0?2013-08-28 04:25 AM
TIM_Period = 0 turns OFF the timer.
For practical applications of the timer it is generally most effective to put the smaller of the values in TIM_Prescaler, the larger in TIM_Period.2013-08-29 05:15 PM
Set the TIM_Period is the same as set the ARR value?
Which documentation should I read to understand the stm32 firmware library?Thanks :)2013-08-29 05:36 PM
The F1 firmware library should have a .CHM help file describing the library, this will augment the source and examples.
To understand the part you will want to look at thehttp://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00251732.pdf
and