Hello all,
currently I'm trying connect the signal PWM_OUT_TRIG0 (which is in my case the output of PWMA) to the input of PDB0. Due to the fact that I'm unable to get it work I have decided to do a little intermediate step. Therefore I'm trying to route the signal PWM_OUT_TRIG0 to XBAR0_OUT7 so that I'm able to measure it without success - the pin stays low.
I have attached the code which I'm calling directly from my main routine during the initialization. The only output I'm getting is the expected PWM on GD0. I'm running the tests on a TWR-KV46F150M board. Any hints or suggestions?
Best Regards,
Florian
Original Attachment has been moved to: pwm.c.zip
Solved! Go to Solution.
Hi, Florian,
I have checked your code, I think you do not set the PWMA_SM0TCTRL register correctly.
Pls add the code:
// route PWMA to PWM_OUT_TRIG0 port
PWMA->SM[kPWM_Module_0].TCTRL |= (1<<0);
If you set the PWMAOT0 bit in the PWMA_SM0TCTRL, the PWM0_A signal will route to the PWM_OUT_TRIG0, if you clear the PWMAOT0 bit in the PWMA_SM0TCTRL, the PWM_OUT_TRIG0 signal will route to the PWM_OUT_TRIG0.
anyway, you have to set the OUT_TRIG_EN bits by the code:
PWMA->SM[kPWM_Module_0].TCTRL |= (1<<0)|(1<<2)|(1<<4);
Pls have a try.
BR
XiangJun Rong
Hi, Florian,
I have checked your code, I think you do not set the PWMA_SM0TCTRL register correctly.
Pls add the code:
// route PWMA to PWM_OUT_TRIG0 port
PWMA->SM[kPWM_Module_0].TCTRL |= (1<<0);
If you set the PWMAOT0 bit in the PWMA_SM0TCTRL, the PWM0_A signal will route to the PWM_OUT_TRIG0, if you clear the PWMAOT0 bit in the PWMA_SM0TCTRL, the PWM_OUT_TRIG0 signal will route to the PWM_OUT_TRIG0.
anyway, you have to set the OUT_TRIG_EN bits by the code:
PWMA->SM[kPWM_Module_0].TCTRL |= (1<<0)|(1<<2)|(1<<4);
Pls have a try.
BR
XiangJun Rong
Hello XiangJun,
thanks alot - it is working now. Beside the modification in PWMA->SM[kPWM_Module_0].TCTRL I have also changed the the output pin. Unfortunately I wasn't able to use the pin GC7 on the TWR module - after switching to the pin GE0 / XbOut10 everything works fine.
Best Regards,
Florian