Skip to main content
DKuro.1
Associate III
August 10, 2020
Question

Timer registers to be updated simultaneously

  • August 10, 2020
  • 3 replies
  • 1331 views

Hi,

I am using STM32G474 with TIM1, TIM8 and TIM20 and working with STM32CubeIDE.

I want to updatethe ARR, CCR1, CCR2 and CCR3 regs at the same time. I taught that with the preload register it can be done but it doesn't work for me.

So how can I do to set the ARR, CCR1, CCR2 and CCR3 shadow registers and to make them be updated in a, lets say, overflow event of the CNT register?

Thanks!

This topic has been closed for replies.

3 replies

TDK
August 10, 2020

In output compare mode, enable the OCxPE preload bits. You'll need to write all values before an update occurs.

"If you feel a post has answered your question, please click ""Accept as Solution""."
DKuro.1
DKuro.1Author
Associate III
August 11, 2020

Hi, thanks for your answer.

I am working in PWM mode 1. I must work in output compare mode? I think it will work in a different way..

waclawek.jan
Super User
August 11, 2020

PWM is one of the output compare modes. Read the timer chapter in RM.

JW