Are there any more examples of PWM on the TWR-KV58F?

显示  仅  | 搜索替代 

Are there any more examples of PWM on the TWR-KV58F?

549 次查看
Contributor I

I'm using Mcuxpresso and have downloaded the corresponding SDK for this board,

when loading the PWM driver example all I get is three pwm outputs with 25 50 and 75 duty cycle all in phase, which is curious since the example says 3ph PWM.

I understand that I have to modify the VALx registers, but in the example no matter what you do all of these registers are always set to zero.

This is the only page in the reference manual about phase shifted PWMs

Can someone please point me to a good reference on this?

Thank you.


0 项奖励
1 回复

467 次查看
NXP TechSupport
NXP TechSupport


Unfortunately, I have not the phase-shift code for eFlexPWM module based on KV58, but i have the code for DSC, I think you can refer to it.

But you have to modify the code. Before you write any eFlexPWM registers, you have to enable the gated clock of eFlexPWM.

    //enable PWM0 clock

write the pin assignment

void pinsAssignment(void)

    //enable PORTD gated clock
    //set PTE MUX  ALT5






For the PWM initialization, I attach the main.c which is based on the DSC, but the registers are the same.

Maybe the register definition is different.

I suppose that you can use like this:

PWM0_SM0INIT=0xxxxxx; for KV58

Hope it can help you


XiangJun Rong

0 项奖励