How to generate a phase-shifted PWM in asymmetric PWM mode?
- October 5, 2019
- 2 replies
- 4680 views
Hi everyone,
I was just wondering how to configure two PWM Channels of TIM1 to generate two phase shifted PWM signals in asymmetric PWM mode as shown in the attachment.
I'm using a STM32F303 on a custom board with CubeMX and SW4STM32.
According to Reference Manual RM0316 OC1REF1 is triggered by CCR1 and CCR2 as compare values during up- and down-counting and respectively OC1REF2 by CCR3 and CCR4.
Theory all good but how on earth do I configure that in CubeMX? When configuring a TIM channel to asymmetric mode I can only set one CCR value. Do channels 2 and 4 have to be set to 'PWM Generation No Output' and Mode:'Asymmetric PWM' to set CCR3 and CCR4 in the CCR register or how does the timer know all the CCR values to work in asymmetric mode? (See attachment).
Has anyone succeeded to configure with this nice feature on STM32MCUs so far?
cheers
