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.

TMS320F28386D: Configuring EPWM5..8 HRPWM using Sysconfig

Part Number: TMS320F28386D
Other Parts Discussed in Thread: SYSCONFIG

According to the TMS320F2838x datasheet (page 10), ePWM modules 1..8 can be configured as HRPWM.

However, as soon as the "Enable HRPWM Support" checkbox in Sysconfig is ticked, EPWM module selection gets limited to EPWM1..4, despite EPWM5..8 also having HRPWM capability according to the datasheet as well as driverlib code (cf. HRPWM_isBaseValid in hrpwm.h).

Is there any quick workaround/fix for this problem, or will the HRPWM part of these modules need to be configured manually in code?

  • Hello,

    Apologies for the delayed response. Yes, that does appear to be a glitch- that's unfortunate, I'll file a bug report.

    There is a relatively simple workaround. In SysConfig, check the 'Generate Init Function For Each Instance' checkbox in the 'Global Parameters' dropdown of the ePWM page. Configure HRPWM for one of ePWM1-4, then build the project. SysConfig generates a file called board.c, open it. In this file, copy the initialization function for the configured HRPWM. Paste it into another file, and change the ePWM base to something else.

    In this example, I just checked the enable HRPWM box for ePWM 1 and didn't actually set any HRPWM configuration. If I want to have this be for ePWM7, I can simply copy-paste myEPWM1_init() code into another file of my project and change every instance of "myEPWM1_BASE" to EPWM7_BASE. After changing the name of the function to something like myEPWM7_init(), I can call the new initialization function after calling board_init(), and we're done.

    Also change func. name.

    Hope this helps,
    Jason Osborn