2012-09-09 12:55 PM
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/SPA2012-09-09 01:10 PM
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.