Implementing epwm_ex12_​monoshot_m​ode.c in Simulink

2 次查看(过去 30 天)
Hi,
I am using the TMS320F28379D launchpad from Texas instruments and want to implement the example code epwm_ex12_monoshot_mode.c from texas instrumens, but now in Simulink. I got the epwm_ex1_trip_zone.c example working but am lost with setting up digital compare. Any advice would be appreciated!
To add more context. I am trying to use GPIO67 as a rising edge trigger to enable GPIO0 to make a single PWM.

回答(1 个)

Harsh
Harsh 2025-7-17
To set up the "ePWM" Digital Compare so that "GPIO67" (routed via the Input "X‑BAR" and ePWM X‑BAR as "TRIP4") generates a one‑shot pulse on "GPIO0", follow the below steps:
  1. Open your "ePWM Type 1–4 block" and go to the "Digital Compare" tab.
  2. Under "DCA/Event Source", select "TRIP4" (the X‑BAR input from GPIO67).
  3. Assign that source to "DCAEVT2", and set "Event Condition" to “On Rising Edge.”
  4. Scroll down to "DCAEVT2 → Trip Zone", choose "CBC Trip", and select "Force ePWMxA" (or ePWMxB) as the action.
  5. Enable the "Trip Zone Interrupt" for "DCAEVT2" so you can clear the latch afterward.
For more information please refer to the following example from mathworks documentation - https://www.mathworks.com/help/ti-c2000/ug/xbar-example.html

Community Treasure Hunt

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

Start Hunting!

Translated by