Usage of PWM_OUT_TRIG0 on KV4X

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Usage of PWM_OUT_TRIG0 on KV4X

Jump to solution
956 Views
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

Labels (1)
Tags (2)
0 Kudos
Reply
1 Solution
808 Views
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

View solution in original post

2 Replies
809 Views
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

808 Views
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 Kudos
Reply