MPC5744P FlexPWM 0 and 1 synchronization

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

MPC5744P FlexPWM 0 and 1 synchronization

Jump to solution
1,243 Views
alimeraj
Contributor IV

Hi,

I am trying to synchronize FlexPWM1 output with FlexPWM0 using EXT_SYNC interface to initialize the INIT_SEL counter but when I look at the scope I can see that there is about 40ns delay in generation of PWM of FlexPWM1 from FlexPWM0.

FlexPWM0

            (*l_flexpwm_ptr).SUB[0].CTRL2.B.INIT_SEL = 0;
            (*l_flexpwm_ptr).SUB[1].CTRL2.B.INIT_SEL = 2;
            (*l_flexpwm_ptr).SUB[2].CTRL2.B.INIT_SEL = 2;
            (*l_flexpwm_ptr).SUB[3].CTRL2.B.INIT_SEL = 2;

FlexPWM1

            (*l_flexpwm_ptr).SUB[0].CTRL2.B.INIT_SEL = 3;
            (*l_flexpwm_ptr).SUB[1].CTRL2.B.INIT_SEL = 2;
            (*l_flexpwm_ptr).SUB[2].CTRL2.B.INIT_SEL = 2;
            (*l_flexpwm_ptr).SUB[3].CTRL2.B.INIT_SEL = 2;

pastedImage_1.png

Why there is a delay of 40ns, what I could be doing wrong for PWM initialization.

Thanks,

Ali

Tags (2)
1 Solution
918 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

I was curious about your finding so I have tested it myself.

Please see the following:

https://community.nxp.com/docs/DOC-341903 

Peter

View solution in original post

6 Replies
919 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

I was curious about your finding so I have tested it myself.

Please see the following:

https://community.nxp.com/docs/DOC-341903 

Peter

918 Views
alimeraj
Contributor IV

Hi Peter,

Thanks for testing it out.

Your test results perfectly make sense now.

I will try to adjust A0 init as you did to reduce the synchronization time.

Thanks once again.

Regards,

Ali

0 Kudos
918 Views
petervlna
NXP TechSupport
NXP TechSupport

Hi,

40ns seems quite nice synch. Its about one clock cycle.

You can also try to use DMA for FlexPWMx simultaneous start. But I expect result will be much less the same.

Peter

918 Views
alimeraj
Contributor IV

Hi Peter,

Thanks for the update,

So I should assume that EXT_SYNC needs at least one clock cycle to sync the FlexPWM, you mentioned to use DMA but that would give more or less the same result. so is there any other way to reduce this time?

Regards,

Ali

0 Kudos
918 Views
petervlna
NXP TechSupport
NXP TechSupport

Well, all this depends on the application requirements.

If you need more than 12 synchronized PWM signals (for example combustion engine control) you should use device with eTPU which is designed for such purpose.

FlexPWM primary use is to drive electric motor for which are 12 PWM signals sufficient.

Peter

0 Kudos
918 Views
alimeraj
Contributor IV

Hi Peter,

Strangely we are using your MPC5744P MCU in our 3 different Motor Control products. we have got a new project which require to drive 2 inverter at the same time with the same duty so that is why the 40ns is bit more crucial in terms of driving the inverter. We already have control board architecture in place for 2 motor independent control but we want to use the same control board to drive 2 inverter in a single motor. so for this application i want to synchronize the two flexPWM together. 

I hope I have provided enough information.

my question is still the same, is there anyway to reduce the reload latency for FlexPWM1 using Ext_SYNC from FlexPWM0.

Regards,

Ali

0 Kudos