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.

TMS320F28388D: How to disable immediately PWM?

Part Number: TMS320F28388D


Hello.

I use processor TMS320F28388 .

I use PWM in my work.
It generates the desired signal.

And i have quetion.

How to programmatically disable PWM immediately?

  • You can use TZ module to disable the PWM immediate.

  • You can use TZ module to disable the PWM immediate

    I have read about the tripZone module.
    But I didn't find a function to disable PWM outputs.

    //
    // Trip Zone module related APIs
    //
    //*****************************************************************************
    //
    //! Enables Trip Zone signal.
    //!
    //! \param base is the base address of the EPWM module.
    //! \param tzSignal is the Trip Zone signal.
    //!
    //! This function enables the Trip Zone signals specified by tzSignal as a
    //! source for the Trip Zone module.
    //! Valid values for tzSignal are:
    //!   - EPWM_TZ_SIGNAL_CBC1       - TZ1 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC2       - TZ2 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC3       - TZ3 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC4       - TZ4 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC5       - TZ5 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC6       - TZ6 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_DCAEVT2    - DCAEVT2 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_DCBEVT2    - DCBEVT2 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_OSHT1      - One-shot TZ1
    //!   - EPWM_TZ_SIGNAL_OSHT2      - One-shot TZ2
    //!   - EPWM_TZ_SIGNAL_OSHT3      - One-shot TZ3
    //!   - EPWM_TZ_SIGNAL_OSHT4      - One-shot TZ4
    //!   - EPWM_TZ_SIGNAL_OSHT5      - One-shot TZ5
    //!   - EPWM_TZ_SIGNAL_OSHT6      - One-shot TZ6
    //!   - EPWM_TZ_SIGNAL_DCAEVT1    - One-shot DCAEVT1
    //!   - EPWM_TZ_SIGNAL_DCBEVT1    - One-shot DCBEVT1
    //!
    //! \b note:  A logical OR of the valid values can be passed as the tzSignal
    //!           parameter.
    //!
    //! \return None.
    //
    //*****************************************************************************
    static inline void
    EPWM_enableTripZoneSignals(uint32_t base, uint16_t tzSignal)
    {
        //
        // Check the arguments
        //
        ASSERT(EPWM_isBaseValid(base));
    
        //
        // Set the trip zone bits
        //
        EALLOW;
        HWREGH(base + EPWM_O_TZSEL) |= tzSignal;
        EDIS;
    }
    
    //*****************************************************************************
    //
    //! Disables Trip Zone signal.
    //!
    //! \param base is the base address of the EPWM module.
    //! \param tzSignal is the Trip Zone signal.
    //!
    //! This function disables the Trip Zone signal specified by tzSignal as a
    //! source for the Trip Zone module.
    //! Valid values for tzSignal are:
    //!   - EPWM_TZ_SIGNAL_CBC1       - TZ1 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC2       - TZ2 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC3       - TZ3 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC4       - TZ4 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC5       - TZ5 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_CBC6       - TZ6 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_DCAEVT2    - DCAEVT2 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_DCBEVT2    - DCBEVT2 Cycle By Cycle
    //!   - EPWM_TZ_SIGNAL_OSHT1      - One-shot TZ1
    //!   - EPWM_TZ_SIGNAL_OSHT2      - One-shot TZ2
    //!   - EPWM_TZ_SIGNAL_OSHT3      - One-shot TZ3
    //!   - EPWM_TZ_SIGNAL_OSHT4      - One-shot TZ4
    //!   - EPWM_TZ_SIGNAL_OSHT5      - One-shot TZ5
    //!   - EPWM_TZ_SIGNAL_OSHT6      - One-shot TZ6
    //!   - EPWM_TZ_SIGNAL_DCAEVT1    - One-shot DCAEVT1
    //!   - EPWM_TZ_SIGNAL_DCBEVT1    - One-shot DCBEVT1
    //!
    //! \b note:  A logical OR of the valid values can be passed as the tzSignal
    //!           parameter.
    //!
    //! \return None.
    //
    //*****************************************************************************
    static inline void
    EPWM_disableTripZoneSignals(uint32_t base, uint16_t tzSignal)
    {
        //
        // Check the arguments
        //
        ASSERT(EPWM_isBaseValid(base));
    
        //
        // Clear the trip zone bits
        //
        EALLOW;
        HWREGH(base + EPWM_O_TZSEL) &= ~tzSignal;
        EDIS;
    }
    
    //*****************************************************************************

    I see PWM signals being disabled here only due to external signals.

    I want to disable and enable PWM programmatically.

    how to do it?

  • You mean you want to use SW to disable and enable?

  • You mean you want to use SW to disable and enable?

    What do you mean by SW?

    I have PWM configured. And I want to programmatically turn on the output signals and then turn them off.

  • There is a SW FRC for the TZ module. it is a register (driverlib function that you can call ) and it will disable your EPWM by TRIPing it.