Skip to main content
FKarg.1
Associate
March 16, 2022
Question

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

  • March 16, 2022
  • 3 replies
  • 1593 views

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

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
March 16, 2022

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

JW

FKarg.1
FKarg.1Author
Associate
March 16, 2022

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
March 16, 2022

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""."