PWM output after stop low

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User9076
Level 1
Level 1
Hello,
I would like to generate a slow PWM (turn signal for a car). For that I use to inputs (IN_L and IN_R) to control two different PWM (CCU4). If i stop one PWM at that moment that the assigend output channel is on, it will remain on. How can I change the behaviour so that the output is low?
Thanks
M.Schneiders
0 Likes
2 Replies
Not applicable
Do you mean stop by software or an external event? If you stop it by software, then make sure you clear the timer when you stop it (set both CC4yTCCLR.TRBC and CC4yTCCLR.TCC).
If by external event, set CC4yTC.ENDM to 11 so the timer flushes when gets stopped.
0 Likes
User9076
Level 1
Level 1
Stop by software with the function PWM_CCU4_Stop. After stoping the PWM the assigned output pin should be low.
Where do I find the registers that you mentioned?
Inside of PWM stop function used timer ist stoped an cleared:
    XMC_CCU4_SLICE_StopTimer(handle_ptr->ccu4_slice_ptr);
XMC_CCU4_SLICE_ClearTimer(handle_ptr->ccu4_slice_ptr);
XMC_CCU4_DisableClock(handle_ptr->ccu4_module_ptr, handle_ptr->slice_number);
0 Likes