AnsweredAssumed Answered

MPC574xP FlexPWM submodule 1 problem

Question asked by Mark Lukek on Feb 4, 2019
Latest reply on Feb 5, 2019 by Petr Stancik

Hello,

 

I'm having trouble with FlexPWM module on MPC574xP. I'm using submodules 0, 1 and 2.

Below is my confunguration for FlexPWM. Is that right config? Submodule 0 and 2 are giving right duty cycles, but submodule 1 doesn't. 

 

FlexPWM_0.OUTEN.R = 0xFF0;

FlexPWM_0.SUB[0].CTRL1.R = 0x0464;
FlexPWM_0.SUB[0].CTRL2.R = 0xA000;
FlexPWM_0.SUB[0].INIT.R = 0;
FlexPWM_0.SUB[0].VAL0.R = 0;
FlexPWM_0.SUB[0].VAL1.R = 0xFFFF;
FlexPWM_0.SUB[0].VAL2.R = 0x1;
FlexPWM_0.SUB[0].VAL3.R = 0x2222;
FlexPWM_0.SUB[0].VAL4.R = 0x1;
FlexPWM_0.SUB[0].VAL5.R = 0x7777;
FlexPWM_0.SUB[0].DTCNT0.R = 0x0000;
FlexPWM_0.SUB[0].DTCNT1.R = 0x0000;
FlexPWM_0.SUB[0].DISMAP.R = 0x0000;

FlexPWM_0.SUB[1].CTRL1.R = 0x0464;
FlexPWM_0.SUB[1].CTRL2.R = 0xA200;
FlexPWM_0.SUB[1].INIT.R = 0;
FlexPWM_0.SUB[1].VAL0.R = 0;
FlexPWM_0.SUB[1].VAL1.R = 0xFFFF;
FlexPWM_0.SUB[1].VAL2.R = 0x1;
FlexPWM_0.SUB[1].VAL3.R = 0x2222;
FlexPWM_0.SUB[1].VAL4.R = 0x1;
FlexPWM_0.SUB[1].VAL5.R = 0x7777;
FlexPWM_0.SUB[1].DTCNT0.R = 0x0000;
FlexPWM_0.SUB[1].DTCNT1.R = 0x0000;
FlexPWM_0.SUB[1].DISMAP.R = 0x0000;

FlexPWM_0.SUB[2].CTRL1.R = 0x0464;
FlexPWM_0.SUB[2].CTRL2.R = 0xA200;
FlexPWM_0.SUB[2].INIT.R = 0;
FlexPWM_0.SUB[2].VAL0.R = 0;
FlexPWM_0.SUB[2].VAL1.R = 0xFFFF;
FlexPWM_0.SUB[2].VAL2.R = 0x1;
FlexPWM_0.SUB[2].VAL3.R = 0x4444;
FlexPWM_0.SUB[2].VAL4.R = 0x1;
FlexPWM_0.SUB[2].VAL5.R = 0xBBBB;
FlexPWM_0.SUB[2].DTCNT0.R = 0x0000;
FlexPWM_0.SUB[2].DTCNT1.R = 0x0000;
FlexPWM_0.SUB[2].DISMAP.R = 0x0000;
FlexPWM_0.MCTRL.B.LDOK = 0xF;
while (FlexPWM_0.MCTRL.B.LDOK == 0xF);

FlexPWM_0.MCTRL.B.RUN = 0xF;

 

Thanks

Outcomes