STM32H503 – ADC trigger shifting from OFF midpoint at duty > 50% in center-aligned complementary PWM
- April 17, 2026
- 2 replies
- 95 views
Subject: STM32H503 – ADC trigger shifting from OFF midpoint at duty > 50% in center-aligned complementary PWM
Hi all,
I am working on a DC-DC converter using the STM32H503RBT6. I have configured TIM1 to generate:
Two complementary PWM pairs
180° phase shift between the two PWM channels
Center-aligned mode 1
Additionally, I am generating:
Two ADC trigger events (using TRGO/TRGO2)
These triggers are also intended to be 180° phase-shifted
Trigger frequency is the same as the PWM frequency
:direct_hit: Requirement
For both PWM phases, the ADC trigger should occur:
At the midpoint of the OFF time of the high-side (top) switch
This is required for accurate current sensing.
:gear: Current Implementation
Timer: TIM1 in center-aligned mode
Complementary PWM enabled
Interleaving achieved using PWM mode 1 and PWM mode 2
Two trigger sources:
One near CNT = 0
One near CNT = ARR
ADC is triggered using TIM1 TRGO and TRGO2
:exclamation_mark: Problem
For duty cycle up to 50%, both triggers correctly occur at the midpoint of the OFF time
When duty cycle exceeds 50%, one of the trigger points shifts:
From the OFF-time midpoint
Into the ON-time region of the PWM
This causes incorrect ADC sampling.
:magnifying_glass_tilted_left: Observation
The issue becomes more prominent at higher duty cycles
Dead time (previously ~500 ns) also affects the effective OFF window
It appears that the trigger point is no longer aligned with the OFF region when duty increases
:question_mark: Question
Why does the trigger shift into the ON region when duty > 50% in center-aligned mode?
Is this due to the way compare events behave during up/down counting?
What is the correct method to ensure:
Fixed 180° phase shift between triggers
AND ADC sampling always at the midpoint of the OFF time?
:paperclip: Additional Info
I have attached:
TIM1 PWM configuration code
ADC configuration
Interrupt/duty update logic
Any guidance or recommended approach would be very helpful.
Thanks in advance!
