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:如何立即禁用 PWM?

Guru**** 2350610 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1116001/tms320f28388d-how-to-disable-immediately-pwm

器件型号:TMS320F28388D

你好。

我使用处理器 TMS320F28388。

我在工作中使用 PWM。
它会生成所需的信号。

我有问题。

如何立即以编程方式禁用 PWM?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您可以使用 TZ 模块来禁用 PWM 立即模式。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [~ userid="280106" URL"/support/microcontrollers/C2000-microcontrollers-group/C2000/f/C2000-microcontrollers-forum/1116001/tms320f28388d-How to disable-immediate-PWM/4138070#4138070"]您可以使用 TZ 模块禁用 PWM 立即生效

    我已经阅读了 tripZone 模块的相关内容。
    但我找不到用于禁用 PWM 输出的函数。

    //
    // 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;
    }
    
    //*****************************************************************************

    我在这里看到仅由于外部信号而禁用 PWM 信号。

    我希望以编程方式禁用和启用 PWM。

    如何操作?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您是要使用 SW 来禁用和启用?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    [~ userid="280106" URL"/support/microcontrollers/C2000-microcontrollers-group/C2000/f/C2000-microcontrollers-forum/1116001/tms320f28388d-How to disable-immediate-PWM/4141208#4141208"]您是指要使用软件禁用和启用?

    您说的 SW 是什么意思?

    我配置了 PWM。 我希望以编程方式打开输出信号、然后将其关闭。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    TZ 模块有一个 SW FRC。它是一个寄存器(您可以调用的 driverlib 函数),它将通过三次来禁用 ePWM。