cancel
Showing results for 
Search instead for 
Did you mean: 

Changing timer frequency by writing the AutoReload Register every 10 microseconds with DMA on a STM32H743

FKarg.1
Associate

Basically, the frequency change already works. My problem is that the new frequency, which is specified by DMA, only takes effect after the ARR has been reached.

I tried to solve the problem by disabling the auto-reload (ARR) preload.

unfortunately in this case no update event is generated if the ARR is written to a lower value than the current count value. As a result, the next update event is only generated when the counter overflows.

Do you have any idea how the ARR will take effect immediately without a counter overflow?

thank you in advance for your help

Florian

3 REPLIES 3

Run a second DMA which will force update by writing 1 to TIMx_EGR.UG.

JW

FKarg.1
Associate

Thank you for your quick reply.

Unfortunately, the update must not be generated cyclically. That would only allow frequencies greater than the DMA frequency.

The update event should be generated if

counter >= AutoReload Register

TDK
Guru

Use the timer in downcounting mode instead. Update won't be immediate, but it will avoid the other issue.

If you feel a post has answered your question, please click "Accept as Solution".