Consult the PWM datasheet. It indicates how to link multiple PWMs together to be synchronized.
2 of 2 people found this helpful
Cy_TCPWM_TriggerStart API is intended to trigger one or more TCPWMs at once.
So, to implement needed by you functionality, I used this API, but changed starting counter value for one of PWMs:
uint32_t PHASE_SHIFT = 20; (void)Cy_TCPWM_PWM_Init(pwm_1_HW, pwm_1_NUM, &pwm_1_config); (void)Cy_TCPWM_PWM_Init(pwm_2_HW, pwm_2_NUM, &pwm_2_config); Cy_TCPWM_PWM_Enable(pwm_1_HW, pwm_1_NUM); Cy_TCPWM_PWM_Enable(pwm_2_HW, pwm_2_NUM); Cy_TCPWM_PWM_SetCounter(pwm_1_HW, pwm_1_NUM, PHASE_SHIFT); /* pwm_1 and pwm_2 should belong to same TCPWM block group (TCPWM0 or TCPWM1) */ Cy_TCPWM_TriggerStart(pwm_1_HW, pwm_1_MASK | pwm_2_MASK);
Here is how it look like on logical analyzer for waveform with 25% duty cycle:
Good luck with development on PSoC!