gravity123
Junior Member level 1
I am working with TIM1 on an STM32 microcontroller, which has two channels (Channel 1 and Channel 2) with complementary outputs. I’m configuring it to generate a sine wave for an H-bridge as follows:
Specifically, I need to know:
- Positive Half-Cycle: PWM signals drive MOSFETs Q1 and Q4, while MOSFETs Q2 and Q3 remain off.
- Negative Half-Cycle: PWM signals drive MOSFETs Q2 and Q3, while MOSFETs Q1 and Q4 remain off.
Specifically, I need to know:
- How to efficiently feed sine wave values to CCR1 and CCR2 using DMA.
- Can a single lookup table be used to handle the entire sine wave, or is it better to handle each half-cycle separately? Should I first feed values for the positive half-cycle and then invert the polarity for the negative half-cycle?