Example MPC5744P FlexPWM CTU SGEN triggering

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

Example MPC5744P FlexPWM CTU SGEN triggering

Example MPC5744P FlexPWM CTU SGEN triggering

********************************************************************************

* Detailed Description:

*

*

* This example shows usage of FlexPWM and Sine Wave generator (SGEN) modules.

* The setting is selected in the way to have a PWM output signal synhronized with

* SWG output signal. This is necessary for resolver usage in motor control appls.

* The CTU_0 is triggered from FlexPWM_0's. The PMWB output rising edge is used here.

* The CTU generates the eTIMER1_TRG signal, that is a trigger signal for the

* SGEN module. The delay between PWMB and SGEN trigger is changed so you can see

* the generated sinusoidal signal change phase against the PWMB output.

*

* See attached Excel sheet for calculation of parammeters used here (AUX0_clk_DIV0,

* AUX0_clk_DIV1, SGEN_IOFREQ, PWM_PRESCALER, PWM_MODULO).

*

* This example is set for 9.765625KHz SGEN/PWM frequency.

*

* Note  because the SGEN trigger input is an asynchronous signal, it must be held high

* for at least 2 SGEN clock cycles in order to capture the input trigger.

* As the CTU generates the trigger as a pulse of single CTU clock width, the CTU clock must be

* half of the SGEN clock at least.

*

* Use the AUX0_clk_DIV0 to test this behaviour.

*

*

* ------------------------------------------------------------------------------

* Test HW:  MPC57xx

* Maskset:  1N65H

* Target :  internal_FLASH

* Fsys:     200 MHz PLL with 40 MHz crystal reference

*

* EVB connection:

*

* P11.8 - D[7] .. SGEN output

*          connected to FEC PHY's MIIMODE input on motherboard,

*          to see full amplitude remove J26   

*

* P8.12    - A[11] .. FlexPWM A[0] output

* P8.11    - A[10] .. FlexPWM B[0] output

*

*

********************************************************************************

Labels (1)
Attachments
%3CLINGO-SUB%20id%3D%22lingo-sub-1100734%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EExample%20MPC5744P%20FlexPWM%20CTU%20SGEN%20triggering%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1100734%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E********************************************************************************%3C%2FP%3E%3CP%3E*%20Detailed%20Description%3A%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20This%20example%20shows%20usage%20of%20FlexPWM%20and%20Sine%20Wave%20generator%20(SGEN)%20modules.%3C%2FP%3E%3CP%3E*%20The%20setting%20is%20selected%20in%20the%20way%20to%20have%20a%20PWM%20output%20signal%20synhronized%20with%20%3C%2FP%3E%3CP%3E*%20SWG%20output%20signal.%20This%20is%20necessary%20for%20resolver%20usage%20in%20motor%20control%20appls.%3C%2FP%3E%3CP%3E*%20The%20CTU_0%20is%20triggered%20from%20FlexPWM_0's.%20The%20PMWB%20output%20rising%20edge%20is%20used%20here.%3C%2FP%3E%3CP%3E*%20The%20CTU%20generates%20the%20eTIMER1_TRG%20signal%2C%20that%20is%20a%20trigger%20signal%20for%20the%3C%2FP%3E%3CP%3E*%20SGEN%20module.%20The%20delay%20between%20PWMB%20and%20SGEN%20trigger%20is%20changed%20so%20you%20can%20see%3C%2FP%3E%3CP%3E*%20the%20generated%20sinusoidal%20signal%20change%20phase%20against%20the%20PWMB%20output.%20%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20See%20attached%20Excel%20sheet%20for%20calculation%20of%20parammeters%20used%20here%20(AUX0_clk_DIV0%2C%3C%2FP%3E%3CP%3E*%20AUX0_clk_DIV1%2C%20SGEN_IOFREQ%2C%20PWM_PRESCALER%2C%20PWM_MODULO).%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20This%20example%20is%20set%20for%209.765625KHz%20SGEN%2FPWM%20frequency.%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20Note%26nbsp%3B%20because%20the%20SGEN%20trigger%20input%20is%20an%20asynchronous%20signal%2C%20it%20must%20be%20held%20high%3C%2FP%3E%3CP%3E*%20for%20at%20least%202%20SGEN%20clock%20cycles%20in%20order%20to%20capture%20the%20input%20trigger.%3C%2FP%3E%3CP%3E*%20As%20the%20CTU%20generates%20the%20trigger%20as%20a%20pulse%20of%20single%20CTU%20clock%20width%2C%20the%20CTU%20clock%20must%20be%3C%2FP%3E%3CP%3E*%20half%20of%20the%20SGEN%20clock%20at%20least.%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20Use%20the%20AUX0_clk_DIV0%20to%20test%20this%20behaviour.%20%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20------------------------------------------------------------------------------%3C%2FP%3E%3CP%3E*%20Test%20HW%3A%26nbsp%3B%20MPC57xx%3C%2FP%3E%3CP%3E*%20Maskset%3A%26nbsp%3B%201N65H%3C%2FP%3E%3CP%3E*%20Target%20%3A%26nbsp%3B%20internal_FLASH%3C%2FP%3E%3CP%3E*%20Fsys%3A%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20200%20MHz%20PLL%20with%2040%20MHz%20crystal%20reference%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20EVB%20connection%3A%20%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20P11.8%20-%20D%5B7%5D%20..%20SGEN%20output%3C%2FP%3E%3CP%3E*%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20connected%20to%20FEC%20PHY's%20MIIMODE%20input%20on%20motherboard%2C%3C%2FP%3E%3CP%3E*%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20to%20see%20full%20amplitude%20remove%20J26%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%20P8.12%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20A%5B11%5D%20..%20FlexPWM%20A%5B0%5D%20output%20%3C%2FP%3E%3CP%3E*%20P8.11%26nbsp%3B%26nbsp%3B%26nbsp%3B%20-%20A%5B10%5D%20..%20FlexPWM%20B%5B0%5D%20output%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E*%3C%2FP%3E%3CP%3E********************************************************************************%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1100734%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EGeneral%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
‎09-17-2015 01:16 AM
Updated by: