Part Number: MSP432P401R
Dear team,
How to get Complementary SPWM? Do we have any example code?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP432P401R
Dear team,
How to get Complementary SPWM? Do we have any example code?
Hi Susan,
You can find a PWM code example with two PWMs here:
I believe this line of code could be changed to get the behavior you are wanting for the 2nd PWM:
TIMER_A1->CCTL[2] = TIMER_A_CCTLN_OUTMOD_7; // CCR2 reset/set
Table 19-6 of the TRM shows the different possible settings for the OUTMOD register with their corresponding modes:
https://www.ti.com/lit/ug/slau356i/slau356i.pdf
0x111b corresponds to reset/set (OUTMOD_7)
I would expect OUTMOD_6 and OUTMOD_2 to correspond to Toggle/Set and Toggle/Reset modes respectively.
BR,
Leo