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.

TMS320F28075: All EPWM clocks must be enabled when using HRPWM

Part Number: TMS320F28075

Hi,

I would like to use HRPWM in the microcontroller TMS320F28075 on the modules EPWM2 et  EPWM12. Since the system clock of the microcontroller is 120 MHz, I have to configure the EPWMCLK at 60 MHz (ClkCfgRegs.PERCLKDIVSEL.bit.EPWMCLKDIV = 1). I enable the auto-conversion mode and use the SFO library for the dynamic calibration. Normally I have to enable only the clocks of the two EPWM modules that I want to use (EPWM2 et EPWM12). However the SFO library does not work correctly. So I try to enable the clocks of all the EPWM modules (EPWM1 to EPW12). The SFO library works in this case.

Could you tell me if it is obligatory to enable the clocks of all the EPWM modules to use HRPWM and the SFO library?

Thanks a lot for any answer!

  • You need to enable the clock of EPWM1 for SFO. Can you try that and see if it works.
  • I confirm that your recommandation is good. I enable only the clock of EPWM1. The SFO library work and gives me 112 for MEP_ScaleFactor. If I disable the clock of EPWM1, the SFO library doesn't work correctly and the MEP_ScaleFactor has a false value.

    I try to configure the EPWMCLK = SYSCLK (ClkCfgRegs.PERCLKDIVSEL.bit.EPWMCLKDIV = 1). It seems that I don't have to enable the clock of EPWM1 for the SFO library to work. MEP_ScaleFactor has a good value (59) in this case.

    Could you explain why the SFO library works correctly in this situation?
  • Hi Long,

    The MEP_ScaleFactor values you shared 112 and 59 roughly differs by a division of 2, so everything else staying constant, it seems that the EPWMCLK may have been divided by 2 in your 2nd example. MEP scale factor changes based on EPWMCLK and this is described in the Technical Reference Manual.

    Regards,
    Elizabeth
  • Hi Long,

    We'll look into this to understand the behavior of the SFO function when EPWMCLKDIV is set to divide by 1 & EPWM1 clock is disabled.
    I'll get back to you when we have more information.

    Regards,
    Elizabeth
  • Hi Long,

    We're still looking into this. My apologies for the delay.

    Regards,
    Elizabeth
  • Hi Elizabeth,

    Thanks for your investigation. I have been always waiting for more information.

    Best regards,
    Long
  • Hi Long,

    Thanks for your patience. We looked into this and here are the conclusions we reached.

    There are 2 peripheral clocks relevant here: HRPWM and EPWM1 clocks.
    -HRPWM clock: This should always be enabled for SFO calibration and for any other HRPWM use. To do so, set 1 for the HRPWM bit of the PCLKCR0 register. When HRPWM clock is disabled, SFO will return error.

    -EPWM1 clock: When EPWMCLKDIV=1 (SYSCLK/2): The HRPWM register configuration has a dependency with the EPWM module in this mode. The EPWM1 clock has to be on to enable the logic necessary for the HRPWM to function correctly. This is why EPWM1 clock has to be on in this case for the SFO to pass.
    When EPWMCLKDIV=0 (SYSCLK/1): There's no dependency on EPWM clock for HRPWM configuration in this mode, so only the HRPWM clock needs to be enabled for HRPWM configuration and SFO calibration to complete.

    Regards,
    Elizabeth
  • Hi Elizabeth,

    Thank you for your answer.

    Best regards,
    Long