I’m facing an issue with the update event triggering in STM32 TIM1. I’ve configured TIM1 to generate PWM signals and set the update event to Center-Aligned Mode 3. However, I’ve noticed that the update event is occurring both when the timer’s counter reaches the auto-reload value (ARR) and when it reaches zero. This is causing a problem because I specifically need the update event to occur only at ARR to trigger the ADC for sampling.
In my project, I’m using TIM1 to generate PWM signals on channels CH1, CH1N, CH2, and CH2N. The CCR values for PWM generation are obtained from a DMA array. Additionally, I’m utilizing the update event to trigger the ADC, with ADC values being saved to a buffer via DMA.
While other modes seem to work and produce PWM output. (But it trigger in ARR and Zero in both mode), this issue arises only in Center-Aligned Mode 3. How can I ensure that the update event occurs only at ARR in this mode?
see the configuration picture
enter image description here
enter image description here
My requirement is for the update event to occur only at ARR, following the sequence 0, 1, 2, 3, …, ARR, 3, 2, 1, 0.
Electrone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.