2026-02-02 10:52 AM - last edited on 2026-02-02 11:19 AM by Andrew Neil
Hello everyone,
I'm working on a digital Class D power amplifier project using the **STM32F411CEU6 (Black Pill)** board. I plan to use **TIM1** timer to generate complementary PWM signals with dead-time control for driving a half-bridge or full-bridge output stage.
Current status:
- Studying TIM1 configuration in complementary PWM mode (CH1 and CH1N channels)
- Understanding dead-time setup via the `DTG` field in the `TIM1_BDTR` register
- Looking for practical modulation examples (e.g., triangular carrier + analog/digital input signal)
**My questions:**
1. Are there any official ST examples (HAL/LL) or community-tested implementations of Class D amplifiers on STM32F4 series?
2. What are the recommended PWM frequency ranges (typically 200–400 kHz for audio) and dead-time settings to prevent shoot-through currents?
3. Is it feasible to use the built-in DAC + comparator for analog modulation, or is a fully digital approach (ADC → processing → PWM) preferable?
4. Which MOSFET drivers and output stage topologies would you recommend for beginners?
I would greatly appreciate links to:
- Code examples (CubeMX/HAL or register-level)
- ST application notes on this topic (I found AN4899, but looking for more hands-on examples)
- Circuit design recommendations considering STM32F411 limitations (e.g., TIM1 maximum frequency)
Thank you in advance for your help!
---
**Tips for posting:**
- You can post this as-is — the tone is polite and technically precise, which is valued on ST forums.
- If you already have a schematic of your output stage or partial code, consider attaching it to get more targeted advice.
- Tagging your post with relevant labels like `STM32F4`, `TIM`, `PWM` will improve visibility
2026-02-02 10:59 AM - edited 2026-02-02 11:00 AM
**Tips for posting:**
- You can post this as-is — the tone is polite and technically precise, which is valued on ST forums.
- If you already have a schematic of your output stage or partial code, consider attaching it to get more targeted advice.
- Tagging your post with relevant labels like `STM32F4`, `TIM`, `PWM` will improve visibility
If you're going to use AI, at least proofread before posting.
You're talking to people here, not ChatGPT.
I wish we had a rule here against AI-generated questions. They are so little effort and have such little content.
2026-02-02 11:16 AM - edited 2026-02-02 11:17 AM
@TDK wrote:I wish we had a rule here against AI-generated questions.
The rule is against AI posts - both questions & replies!
Why predominantly AI-generated posts and replies on the ST Community are not allowed
Reported.
2026-02-02 12:20 PM
Hi,
>I'm working on a digital Class D power amplifier project using the **STM32F411CEU6
1. Funny idea - have you ever built a d-amp ?
2. Try building a simple analog modulator d-amp, as i did 20 y ago, search "ucd amplifier schematic" , then try.
3. Read about the limits and the theory , for a full digital amp. Especially modulation, noise shaping and dynamic range.
4. Good Luck !