This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM263P4: Enabling/Disabling multiple PWMs simultaneously

Part Number: AM263P4


Tool/software:

I've configured 4 PWM pairs: PWM0 A/B..PWM3 A/B.

I want to ensure 2 PWM pairs are enabled and disabled simultaneously.  I was hoping to use TripZones to do this.  But ran into 2 issues.

1. Using Force OSHT requires writing to 1 PWM register followed by another.  This is not simultaneous and may enable one PWM before the other by one cycle during counter rollover.

2. Configured both PWM's One-Shot Source to TZ1.  Can TZ1 be triggered by software?  It seems TZ1 requires GPIO input to toggle.  There aren't many GPIO pins available on our board.

3.  I also only want to toggle only 4 at a time, leaving the other 4 PWMs untouched.  Also keeping all 8 PWM clocks in sync.  Disabling/enabling 4 out of 8 PWM clocks may inadvertently put them out of sync.  This is why I prefer to use TZ and not control PWM clocks.

Please help provide suggestions on how I can simultaneously enable/disable 2 pairs of PWMs.

Thanks.

  • Hey Huey,

    Our expert is out-of-office until 06-05-25. Please allow some time for their return and review of the information. Thank you for your patience.

    Best Regards,

    Zackary Fleenor

  • Hi Huey

    Configured both PWM's One-Shot Source to TZ1.  Can TZ1 be triggered by software?  It seems TZ1 requires GPIO input to toggle.  There aren't many GPIO pins available on our board.

    You may not have pins available on the board, but you would still have the gpio pads on the SOC, triggering through those gpio pads seems to be the best way to get synchronous operation for your use case.

    You can trigger a trip event via software without a GPIO. The TZFRC register allows you to force an OST or CBC (Cycle-By-Cycle) trip directly from software for the ePWM module it belongs to. Check out the EPWM_tzTriggerSwEvent(uint32_t baseAddr, uint32_t tzEventType) API

    Another method for simultaneously enabling/disabling the outputs of your 2 pairs of ePWMs (4 modules total) while keeping all 8 ePWMs' clocks running and synchronized is to use the ePWM's Action Qualifier (AQ) settings in conjunction with synchronized shadow register loads.

    Keep All 8 ePWM Clocks Running & Synchronized.

    Use Action Qualifiers (AQ) to Control Outputs:
    1) Configure the AQ settings of the 4 target ePWMs to force their outputs to a static level (e.g., always LOW).
    2) Configure their AQ settings for normal PWM waveform generation.

    Sync Mechanism:
    1) Write to Shadow: First, write the desired new AQ settings to the shadow registers of the 4 ePWMs you want to control. (as changes to shdw registers dont take place immediately)
    2) Single Sync Pulse: Then, Sync-out pulse on master epwm, and sync-in pulse for all other epwm's (can include master as well)
    3) Simultaneous Load: This sync pulse triggers all 4 target ePWMs to copy their new AQ settings from their shadow registers to their active registers at the same time. This results in their outputs changing state simultaneously.

    output on the last method:

    Let me know if it helps!

    Best Regards,
    Akshit