f28335 extern pwm synchronisation

6 views (last 30 days)
Dennis
Dennis on 10 Aug 2012
Hello,
I'm working with eZdsp F28335 Controller and with Matlab Simulink (IDE CCSv3.3)
I have an external signal source (5kHz PWM) and would synchronize the ePWM Moduls on two different F28335 Controller.
Is that possible ?
On the ePWM Moduls I tick the "Add S/W sync input port" (>Input port appears).
Than I connect the GPIO(20) Input (>external PWM) with the "Sync" Input port of the ePWM in my Model.
After that i run the Programm on two different F28335 DSP and connect the external PWM on GPIO(20).
But if i display the two PWM signals on an oscilloscope the two PWM would be phase shifted.
please help me
best regards dennis
  1 Comment
Antonin
Antonin on 17 Aug 2012
Hi Dennis,
I'm not 100% sure I understand your question correctly.
I assume that you will have at least one F28335 trying to synchronize its PWM module with a 5kHz PWM signal.
  • Double-click on your Target Preferences block.
  • Go to the "Peripherals" tab -> ePWM.
  • Select a Pin for the SYNCI. You have the choice between GPIO 6 and 32, pick what suits your hardware design.
  • Click OK.Now, a rising edge on the GPIO you selected will drive a synchronization pulse to the ePWM1 module.
How to take advantage of this synchronization pulse?
  • Double click on your ePWM block, make sure ePWM1 is selected for the module.
  • On the "General" tab, go to "Phase offset source" and select "Specify via dialog". The "Phase offset value" will be passed to the ePWM1 timer on each rising edge of your SYNCI signal. You can keep the "Phase offset value" as zero.
Your ePWM1 module is now synchronized with the SYNCI signal (GPIO 6 or 32 depending on what you selected on the Target Preferences block). Its timer will reset to the phase offset value on each rising edge of the SYNCI signal. You can now go on the ePWMA/B tabs and select the desired actions for the PWM outputs when the counter equals 0.
You don't need a GPIO block in your model and no lines has to be drawn on the Simulink diagram for the synchronization.
You can keep the "Add S/W sync input port" on the ePWM block unchecked as we are using hardware to do the synchronization.
You can also pass the synchronization pulse the next ePWM module by using the "Sync output selection" on the ePWM block. Note that the synchronization output of ePWM1 is also connected to SYNCO that you can output to a GPIO pin (also selectable on the Target Preferences block).
I hope it helps,
Antonin.

Sign in to comment.

Answers (0)

Communities

More Answers in the  Power Electronics Control

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!