TimeBase example in stm32f3discovery_fw
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-17 3:23 AM
Posted on October 17, 2013 at 12:23
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-timer
Labels:
- Labels:
-
STM32F3 Series
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-17 4:36 AM
Posted on October 17, 2013 at 13:36
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.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-18 12:07 AM
Posted on October 18, 2013 at 09:07
Thank you Clive1
