How to create 13 PWM signals with 56F84789

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

How to create 13 PWM signals with 56F84789

881 Views
aneflorez
Contributor I

Hi all,

I am willing to create 13 PWM signals with the MCU56F84789, using CodeWarrior v10.5. I have already created 12 signals, I use the PWMC1:PWMMC component for doing so, but as it only has 6 available channels (ch0-ch5), for creating a 13th signal, I have introduced another component PWMC2:PWMMC.

This is who part of my Events.c looks like:

void PWMC1_OnReload(void)

{

      PESL(PWMA, PWM_SM0_WRITE_VALUE_REG-,…);

      PESL(PWMA, PWM_SM1_WRITE_VALUE_REG-,…);

      PESL(PWMA, PWM_SM2_WRITE_VALUE_REG-,…);

      PWMC1_Load();

}

void PWMC2_OnReload(void)

{

      PESL(PWMA, PWM_SM3_WRITE_VALUE_REG-,…);

      PWMC2_Load();

}

It doesn’t work, but I don’t know why. Could someone help me please? Thank you in advance!

Labels (1)
Tags (1)
0 Kudos
Reply
2 Replies

690 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Ane,

frankly speaking, I do not know your issue clearly.

Anyway, because the MC56F84789 has two eFlexPWM modules, you can generate 13 channels PWM signal which are synchronized:PWMA_0A/PWMA_0B/PWMA_1A/PWMA_1B/PWMA_2A/PWMA_2B/PWMA_3A/PWMA_3B and PWMB_0A/PWMB_0B/PWMB_1A/PWMB_1B/PWMB_2A, it is okay.

You can synchronize the two PWM modules and sub-modules via cross-bar, pls refer to Figure 28-249. Submodule Timer Synchronization.

For example, you can set the INIT_SEL bits as 3 for all sub-modules of PWMB so that external PWM_EXT_SYNC signal can synchronize the PWMB. For PWMA, you can set the INIT_SEL bits as 01 for PWMA_SM1/SM2/SM3, set INIT_SEL bits as 00 for PWMA_SM0 only.

You can set cross-bar so that the PWMA0_Trig1 signal(PWMA0_TRG1)can route to PWMB0_EXT_SYNC/PWMB1_EXT_SYNC/PWMB2_EXT_SYNC

You can set the bit2 in PWMA_SM0TCTRL so that Value1 of PWMA can generate the synchrnizing signal for PWMB.

Hope it can help you

B R

Xiangjun Rong

0 Kudos
Reply

690 Views
aneflorez
Contributor I

Dear X. Rong,

Thank you for your answer. I have synchronized the submodules SM0, SM1 and SM2 in each module, but know I wneed to set a cross-bar between the two modules PWMA and PWMB.

I do not exactly understand, should I route the PWMB0_EXT_SYNC/PWMB1_EXT_SYNC/PWMB2_EXT_SYNC to PWMA0_TRG1, or should I set the bit2 in PWMA_SM0TCTRL, so that the Value 1 of PWMA can generate the synchronizing singal for PWMB? Or should I do both?

And whichever the answer is, how can I do it?? should I set them through code, or using the CodeWarrior? I feel so lost...

Thank you in advance,

Ane.

0 Kudos
Reply