2026-01-16 5:03 AM
Hi everyone,
I’m trying to control the backlight brightness of the display on my STM32N6570-DK using TIM8, channel 2 complementary (CH2N) in PWM mode (it's correct?).
TIM8 clock: 100 MHz (APB2 peripherals)
Prescaler: 49
Auto-reload (ARR): 99 → theoretically 100 brightness steps
PWM mode: PWMN (CH2N)
Output: connected directly to the display BL pin
Timer started with HAL_TIM_PWMN_Start(&htim8, TIM_CHANNEL_2)
PWM only works when using very high PSC and ARR values (e.g., PSC=512, ARR=3126), but then the PWM frequency is very low (~60 Hz).
With proper values for ~20 kHz PWM and 1000 brightness steps (PSC=4, ARR=999), the display is either fully on or fully off — no intermediate steps are visible.
The display pin seems to accept only CH2N, not CH2 normal.
Is there an “official” way to drive the STM32N6570-DK backlight using PWMN with linear, visible steps?
Are there any STM examples for backlight PWM on this DK board using TIM8_CH2N?
Thanks in advance for any suggestions or examples!
Solved! Go to Solution.
2026-01-16 5:52 AM - edited 2026-01-16 5:53 AM
Hi,
from circuit https://www.st.com/resource/en/schematic_pack/mb1860-rk050hr18c-b01-schematic.pdf
So any PWM with 100...10k Hz should work fine.
So set for example PSC 40 , ARR 3000 ; should give good range (but our eyes not linear, so 50% pwm is not "half brightness" )
2026-01-16 5:52 AM - edited 2026-01-16 5:53 AM
Hi,
from circuit https://www.st.com/resource/en/schematic_pack/mb1860-rk050hr18c-b01-schematic.pdf
So any PWM with 100...10k Hz should work fine.
So set for example PSC 40 , ARR 3000 ; should give good range (but our eyes not linear, so 50% pwm is not "half brightness" )
2026-01-16 6:35 AM
Thank you very much for the quick reply.
I have one follow-up question to better understand the behavior I’m seeing.
With values like PSC = 40 and ARR = 3000, the backlight works correctly and I can see brightness changes.
However, when I use much smaller values, for example PSC = 25 and ARR = 100, the display remains completely off, even when I change the duty cycle. In this case, the PWM frequency is 40 kHz, which is well within the recommended range for driving the backlight.
Why this happens? From my understanding, both configurations should generate a valid PWM signal, only with a different frequency and resolution.
Thank you very much
2026-01-16 7:21 AM
Maybe there is a RC filter to prevent spikes giving a flashlight effect (i would do it and put a RC filter in).
So I suggested a medium frequency setting, good over the visible flicker (< 50Hz), but not too high.
Or you have to set the ch2n pin to higher pin speed...anyway, to know how the signal looks, you have to use a scope to see it. And check ds of the TPSxx , what its doing when light "modulation" is in xx kHz range.
Or you just want it working...then use the suggested/working values. ...and look for the next problem. :)