2026-04-17 12:31 AM
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
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.
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
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.
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
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?
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!
2026-04-17 12:52 AM
Please don't AI generate the questions to forum. Or at least have the decency to hand-edit it to be humanly readable.
How do you know where is the ADC trigger point?
What is the TIM1 period?
JW
2026-04-17 12:57 AM
2026-04-17 1:27 AM
I don't use Cube/HAL/CubeMX so don't uderstand that code.
So, you say, that the output of channels you are using for ADC triggering is not where you expect them to be? In that case, it's not related to ADC at all, is it? It's a purely TIM-related issue, then.
Can you please read out and post content of TIM registers in the "working" and in the "non-working" state, together with oscilloscope screenshots for the respective states?
JW