Synchronizing eFlexPWM Submodules (PWMA0, PWMA1, PWMB1, PWMB2) on MC56F84789

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

Synchronizing eFlexPWM Submodules (PWMA0, PWMA1, PWMB1, PWMB2) on MC56F84789

299 Views
GuilhermeTodys
Contributor I

I am using the MC56F84789 DSC and I need to synchronize the outputs PWMA0, PWMA1, PWMB1, and PWMB2 so they start at the exact same clock cycle without any delay.

I am using CodeWarrior 11.1. I have read in the reference manual that synchronization between submodules is possible via the MCTRL register, but I am struggling to implement this correctly in C.

My current understanding:

  • PWMA0/B0 belong to Submodule 0.

  • PWMA1/B1 belong to Submodule 1, and so on.

  • I need to use a "Master Reload" or "Master Sync" signal.

Questions:

  1. How should I configure the CTRL2[INIT_SEL] and CTRL2[MASTER_RELOAD] bits to ensure all submodules use the same timing reference?

  2. What is the correct sequence in CodeWarrior to set the LDOK bits in the MCTRL register simultaneously for multiple submodules?

  3. If I am using Processor Expert, which properties should I change to enable this hardware synchronization?

Any code example or register configuration sequence would be very helpful.

0 Kudos
Reply
1 Reply

249 Views
Celeste_Liu
NXP Employee
NXP Employee

Hello @GuilhermeTodys ,

Thanks for your post. We have previously provided a sharing on this topic. Kindly refer to it for details.

Two or more eFlexPWM synchronization for KV4x, KV5x, MC56F84xxx and MC56F82xxx

Hope it helps.

BR

Celeste

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2266374%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ESynchronizing%20eFlexPWM%20Submodules%20(PWMA0%2C%20PWMA1%2C%20PWMB1%2C%20PWMB2)%20on%20MC56F84789%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2266374%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EI%20am%20using%20the%20%3CSTRONG%3EMC56F84789%3C%2FSTRONG%3E%20DSC%20and%20I%20need%20to%20synchronize%20the%20outputs%20%3CSTRONG%3EPWMA0%2C%20PWMA1%2C%20PWMB1%2C%20and%20PWMB2%3C%2FSTRONG%3E%20so%20they%20start%20at%20the%20exact%20same%20clock%20cycle%20without%20any%20delay.%3C%2FP%3E%3CP%3EI%20am%20using%20%3CSTRONG%3ECodeWarrior%2011.1%3C%2FSTRONG%3E.%20I%20have%20read%20in%20the%20reference%20manual%20that%20synchronization%20between%20submodules%20is%20possible%20via%20the%20%3CSTRONG%3EMCTRL%3C%2FSTRONG%3E%20register%2C%20but%20I%20am%20struggling%20to%20implement%20this%20correctly%20in%20C.%3C%2FP%3E%3CP%3E%3CSTRONG%3EMy%20current%20understanding%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CUL%3E%3CLI%3E%3CP%3EPWMA0%2FB0%20belong%20to%20Submodule%200.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPWMA1%2FB1%20belong%20to%20Submodule%201%2C%20and%20so%20on.%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EI%20need%20to%20use%20a%20%22Master%20Reload%22%20or%20%22Master%20Sync%22%20signal.%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%3CSTRONG%3EQuestions%3A%3C%2FSTRONG%3E%3C%2FP%3E%3COL%3E%3CLI%3E%3CP%3EHow%20should%20I%20configure%20the%20%3CSTRONG%3ECTRL2%5BINIT_SEL%5D%3C%2FSTRONG%3E%20and%20%3CSTRONG%3ECTRL2%5BMASTER_RELOAD%5D%3C%2FSTRONG%3E%20bits%20to%20ensure%20all%20submodules%20use%20the%20same%20timing%20reference%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EWhat%20is%20the%20correct%20sequence%20in%20CodeWarrior%20to%20set%20the%20%3CSTRONG%3ELDOK%3C%2FSTRONG%3E%20bits%20in%20the%20%3CSTRONG%3EMCTRL%3C%2FSTRONG%3E%20register%20simultaneously%20for%20multiple%20submodules%3F%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EIf%20I%20am%20using%20Processor%20Expert%2C%20which%20properties%20should%20I%20change%20to%20enable%20this%20hardware%20synchronization%3F%3C%2FP%3E%3C%2FLI%3E%3C%2FOL%3E%3CP%3EAny%20code%20example%20or%20register%20configuration%20sequence%20would%20be%20very%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2266680%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Synchronizing%20eFlexPWM%20Submodules%20(PWMA0%2C%20PWMA1%2C%20PWMB1%2C%20PWMB2)%20on%20MC56F84789%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2266680%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F258183%22%20target%3D%22_blank%22%3E%40GuilhermeTodys%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%0A%3CP%3EThanks%20for%20your%20post.%26nbsp%3BWe%20have%20previously%20provided%20a%20sharing%20on%20this%20topic.%20Kindly%20refer%20to%20it%20for%20details.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FDigital-Signal-Controllers%2FTwo-or-more-eFlexPWM-synchronization-for-KV4x-KV5x-MC56F84xxx%2Fta-p%2F1128526%22%20target%3D%22_blank%22%3ETwo%20or%20more%20eFlexPWM%20synchronization%20for%20KV4x%2C%20KV5x%2C%20MC56F84xxx%20and%20MC56F82xxx%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EHope%20it%20helps.%3C%2FP%3E%0A%3CP%3EBR%3C%2FP%3E%0A%3CP%3ECeleste%3C%2FP%3E%3C%2FLINGO-BODY%3E