how to update TIM_Period when timer i running
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-09-09 12:55 PM
Posted on September 09, 2012 at 21:55
Hi
I need to be able to update the Period for a timer (TIM3) I though it was simple, but no.I have tried :else if(TIM_GetITStatus(TIM3, TIM_IT_Update) != RESET){ ledTimeBaseStructure.TIM_Period = newValue; TIM_TimeBaseInit(TIM3, &ledTimeBaseStructure); TIM_ClearITPendingBit(TIM3, TIM_IT_Update);}but without any look, the period should be around 1 sek, but it is around 1 – 2 ms.There must be a simple solution, so I hope any one can help, thanks/SPA
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2012-09-09 1:10 PM
Posted on September 09, 2012 at 22:10
TIM3->ARR = newValue;
Now it's only going to be in the second range if you have a suitably large prescale value so the time base is operating in the tens of kilohertz range. Both the prescale and period registers are typically 16-bit, with the implied range limitation they bring.
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..
