demo: timer: BUGFIX: TIM6 prescaler
TIM6 has clock running at 84MHz instead of 168MHz, so set the prescaler accordingly. Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
This commit is contained in:
parent
187d01e3b2
commit
4b23cb4850
1 changed files with 1 additions and 1 deletions
|
|
@ -72,7 +72,7 @@ static void clock_setup(void)
|
|||
static void tim6_setup(void)
|
||||
{
|
||||
timer_reset(TIM6);
|
||||
timer_set_prescaler(TIM6, 16800 - 1); // 168Mhz/10000hz - 1
|
||||
timer_set_prescaler(TIM6, 8400 - 1); // 84Mhz/10kHz - 1
|
||||
timer_set_period(TIM6, 65535); // Overflow in ~6.5 seconds
|
||||
timer_enable_counter(TIM6);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue