cancel
Showing results for 
Search instead for 
Did you mean: 

Timer updates only after i set a breakpoint

Hesseltjuuh
Associate III

I'm using an STM32F401RCT6 to create a very accurate millisecond timer for a school project. When the second interrupt of the alarm triggers i set a new CCR1 value and reset the timer. But it seems like the timer just ignores this. Only when i set a breakpoint in the function and resume it updates. Can anyone help me?

Everything else works, i get a square wave of 50%. But it just doesnt seem to update.

 

Hesseltjuuh_0-1703784283302.png

Hesseltjuuh_1-1703784292024.png

Hesseltjuuh_3-1703784392779.png

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Timer prescaler TIMx_PSC is unconditionally preloaded, it means, that the new value does not get into effect until the next Update (overflow) of the timer.

TIMx_CCRx may be preloaded, too; see TIMx_CCMRx.OCxPE.

JW

View solution in original post

1 REPLY 1

Timer prescaler TIMx_PSC is unconditionally preloaded, it means, that the new value does not get into effect until the next Update (overflow) of the timer.

TIMx_CCRx may be preloaded, too; see TIMx_CCMRx.OCxPE.

JW