MPC574xP FlexPWM submodule 1 problem

cancel
Showing results for 
Search instead for 
Did you mean: 

MPC574xP FlexPWM submodule 1 problem

259 Views
mark_registraci
Contributor II

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

0 Kudos
1 Reply

149 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I do not see issue with the init, it gives me the same duty cycle on submodules 0 and 1

pastedImage_1.png

If you do duty cycle update try to disable imediate registers update, so use LDMOD=0

BR, Petr

0 Kudos