Usage of PWM_OUT_TRIG0 on KV4X

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Usage of PWM_OUT_TRIG0 on KV4X

跳至解决方案
768 次查看
florianharmuth
Contributor II

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

标签 (1)
标记 (2)
0 项奖励
1 解答
620 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

在原帖中查看解决方案

2 回复数
621 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

620 次查看
florianharmuth
Contributor II

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

0 项奖励