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.

TMS320F28379S: Examples that uses ePWM XLINK

Expert 3570 points
Part Number: TMS320F28379S

Hi Champs,

I read this app note: Leverage New Type ePWM Features for Multiple Phase Control. It mentions a ref design TIDA-00961 but seems that it no longer exists (I can't find it anywhere).

May I know if there is another example of using ePWM XLINK?

Regards,

Kien

  • Hi Kien,

    Yes, the TIDA-00961 reference design was removed.

    We do not have any available ready example showcasing the use case of EPWMXLINK feature, but there is a driverlib function available which you can use directly in your EPWM initialization and shouldn't be challenging to implement. Please find below the snippet from epwm.h file:

    //*****************************************************************************
    //
    //! Sets the EPWM links.
    //!
    //! \param base is the base address of the EPWM module.
    //! \param epwmLink is the ePWM instance to link with.
    //! \param linkComp is the ePWM component to link.
    //!
    //! This function links the component defined in linkComp in the current ePWM
    //! instance with the linkComp component of the ePWM instance defined by
    //! epwmLink. A change (a write) in the value of linkComp component of epwmLink
    //! instance, causes a change in the current ePWM linkComp component.
    //! For example if the current ePWM is ePWM3 and the values of epwmLink and
    //! linkComp are EPWM_LINK_WITH_EPWM_1 and EPWM_LINK_COMP_C respectively,
    //! then a write to COMPC register in ePWM1, will result in a simultaneous
    //! write to COMPC register in ePWM3.
    //! Valid values for epwmLink are:
    //!   - EPWM_LINK_WITH_EPWM_1  - link current ePWM with ePWM1
    //!   - EPWM_LINK_WITH_EPWM_2  - link current ePWM with ePWM2
    //!   - EPWM_LINK_WITH_EPWM_3  - link current ePWM with ePWM3
    //!   - EPWM_LINK_WITH_EPWM_4  - link current ePWM with ePWM4
    //!   - EPWM_LINK_WITH_EPWM_5  - link current ePWM with ePWM5
    //!   - EPWM_LINK_WITH_EPWM_6  - link current ePWM with ePWM6
    //!   - EPWM_LINK_WITH_EPWM_7  - link current ePWM with ePWM7
    //!   - EPWM_LINK_WITH_EPWM_8  - link current ePWM with ePWM8
    //!   - EPWM_LINK_WITH_EPWM_9  - link current ePWM with ePWM9
    //!   - EPWM_LINK_WITH_EPWM_10  - link current ePWM with ePWM10
    //!   - EPWM_LINK_WITH_EPWM_11  - link current ePWM with ePWM11
    //!   - EPWM_LINK_WITH_EPWM_12  - link current ePWM with ePWM12
    //!
    //! Valid values for linkComp are:
    //!   - EPWM_LINK_TBPRD   - link TBPRD:TBPRDHR registers
    //!   - EPWM_LINK_COMP_A   - link COMPA registers
    //!   - EPWM_LINK_COMP_B   - link COMPB registers
    //!   - EPWM_LINK_COMP_C   - link COMPC registers
    //!   - EPWM_LINK_COMP_D   - link COMPD registers
    //!   - EPWM_LINK_GLDCTL2  - link GLDCTL2 registers
    //!
    //! \return None.
    //
    //*****************************************************************************
    static inline void
    EPWM_setupEPWMLinks(uint32_t base, EPWM_CurrentLink epwmLink,
                        EPWM_LinkComponent linkComp)
    {
        //
        // Check the arguments
        //
        ASSERT(EPWM_isBaseValid(base));
    
        uint32_t registerOffset;
        registerOffset = base + EPWM_O_XLINK;
    
        //
        // Configure EPWM links
        //
        HWREG(registerOffset) =
            ((HWREG(registerOffset) & ~((uint32_t)EPWM_XLINK_TBPRDLINK_M << (uint32_t)linkComp)) |
            ((uint32_t)epwmLink << (uint32_t)linkComp));
    }
    

    Best Regards,

    Allison

  • Allison,

    Thanks for your support.

    Regards,

    Kien

  • No problem, Kien! Closing this thread for now. Feel free to open another post should you run into issues.

    Best Regards,

    Allison