Timer 2 Frequency
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2014-04-08 6:48 AM
Posted on April 08, 2014 at 15:48
Hello everyone,
I am trying to Set up timer with 1ms Tick value and it does not seems to be working correctly. TIM_TimeBaseStructure.TIM_Period = TIMER_MAIN_1MS_VAL; TIM_TimeBaseStructure.TIM_Prescaler = 2; TIM_TimeBaseStructure.TIM_ClockDivision = 0; TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;Where TIMER_MAIN_1MS_VAL = A410Clock Freq = 84Mhz. so the formula would be 1/84000000 = 1.1904e^-8 1.1904e^-8 *42000(A410) = .0005 prescalar is 2 so it become .001 means 1ms. But it doesn't seems to be working. Any help guys.. 1/ Clock Freq #stm32 #stm32-timer-counter #stm32-timer
Labels:
- Labels:
-
TIM
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
‎2014-04-08 7:03 AM
Posted on April 08, 2014 at 16:03
Values programmed into Prescaler and Period in the form N-1
Prescaler = 2 - 1; Period = 42000 - 1; (84000000 / 2) / 42000 = 1000 Hz
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
‎2014-04-08 9:49 AM
Posted on April 08, 2014 at 18:49Got it Clive :) Thanks a Ton
