How to syncronize PWMs of different CPUs?

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

How to syncronize PWMs of different CPUs?

Jump to solution
1,546 Views
Alberto_g
Contributor III

Hello, in a multiple motor drive with several MC56F84763, there's the need to syncronize PWMs.

The reference manual says that it is possible, via the crossbar switch, bring out the EXT_CLOCK signal, which is the master clock for the PWM peripheral.

I can't figure out how to initialize the crossbar to do so. Processor Expert doesn't help. Is there a document detailing this configuration?

There is also an EXT_SYNC signal, it is not clear to me if it can be periodically issued at any PWM cycle in proximity of the counter reload event.

Or should it be an one-off initialization signal?

Or I guess maybe it can be accomplished via software, with a periodic interrupt wich resets the PWM counter.

 

Any help would be appreciated, thanks.

 

Alberto

Labels (1)
0 Kudos
1 Solution
1,303 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Alberto,

Of course, it is okay to synchronize on-chip eFlexPWM module with external PWM module of another mcu, but another mcu must generate the synchronization signal so that the eFlexPWM module can synchronize with the external signal.

For the MC56F84xxx processor, there is crossbar module, which can route the external synchronization signal to eFlexPWM signal module. Pls refer to the section 3.3.3.4 XBARA Outputs in the MC56F847xxRM.pdf, I copy it here:

XBAR_OUT24                     PWMA0_EXT_SYNC PWMA0 Ext Synch

XBAR_OUT25                     PWMA1_EXT_SYNC PWMA1 Ext Synch

XBAR_OUT26                     PWMA2_EXT_SYNC PWMA2 Ext Synch

XBAR_OUT27                     PWMA3_EXT_SYNC PWMA3 Ext Synch

For example, assume the eFlexPWMA is synchronized with another mcu, you can connect the PWM  synchronization from another mcu to the package pin from XB_IN2 to XB_IN10, for example connect the PWM synchronization to XB_IN2 pin(GPIOC2 or pin5 of MC56F84789). In the case, you should do the following setting :

1)setting XBAR_OUT24 and XBAR_OUT25 with XB_IN2

XBARA_SEL12=0x0202

2)setting XBAR_OUT26 and XBAR_OUT27 with XB_IN2

XBARA_SEL13=0x0202

For the eFlexPWMA module, if you want to synchronize the PWMA_SM0/PWMA_SM1/PWMA_SM2, you should set the INIT_SEL as 11 in  following register:

PWMA_SM0CTRL2/PWMA_SM1CTRL2/PWMA_SM3CTRL2.

It is okay.

Note you should set the SIM_GPSCL register so that the GPIOC2 pin can function as XB_IN2.

Hope it can help you.

BR

XiangJun Rong

View solution in original post

2 Replies
1,304 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Alberto,

Of course, it is okay to synchronize on-chip eFlexPWM module with external PWM module of another mcu, but another mcu must generate the synchronization signal so that the eFlexPWM module can synchronize with the external signal.

For the MC56F84xxx processor, there is crossbar module, which can route the external synchronization signal to eFlexPWM signal module. Pls refer to the section 3.3.3.4 XBARA Outputs in the MC56F847xxRM.pdf, I copy it here:

XBAR_OUT24                     PWMA0_EXT_SYNC PWMA0 Ext Synch

XBAR_OUT25                     PWMA1_EXT_SYNC PWMA1 Ext Synch

XBAR_OUT26                     PWMA2_EXT_SYNC PWMA2 Ext Synch

XBAR_OUT27                     PWMA3_EXT_SYNC PWMA3 Ext Synch

For example, assume the eFlexPWMA is synchronized with another mcu, you can connect the PWM  synchronization from another mcu to the package pin from XB_IN2 to XB_IN10, for example connect the PWM synchronization to XB_IN2 pin(GPIOC2 or pin5 of MC56F84789). In the case, you should do the following setting :

1)setting XBAR_OUT24 and XBAR_OUT25 with XB_IN2

XBARA_SEL12=0x0202

2)setting XBAR_OUT26 and XBAR_OUT27 with XB_IN2

XBARA_SEL13=0x0202

For the eFlexPWMA module, if you want to synchronize the PWMA_SM0/PWMA_SM1/PWMA_SM2, you should set the INIT_SEL as 11 in  following register:

PWMA_SM0CTRL2/PWMA_SM1CTRL2/PWMA_SM3CTRL2.

It is okay.

Note you should set the SIM_GPSCL register so that the GPIOC2 pin can function as XB_IN2.

Hope it can help you.

BR

XiangJun Rong

1,303 Views
Alberto_g
Contributor III

Thank you very much, I have already had some result by myself and I'm testing your suggestions ASAP.

Regards

Alberto

0 Kudos