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.

TMS320F28376D: HRPWM function setting

Part Number: TMS320F28376D
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hello experts

Hope this finds you well. 

In order to confirm the basic operation of HRPWM, we would like to not assign HRPWM to PWM (made by COMPA), but only to the rising edge of PWM made by COMPB.
Therefore, I set the register based on the reference manual.

But the waveform of both PWMs was the same, and the HRPWM function could not be confirmed.
We believe that there are errors or omissions in the register settings.
Can you tell me which registers I need to set in order to use HRPWM?

The registers currently set for HRPWM on our side are as follows.

Regards,

Jieyu

  • Hello,

    Just to clarify first, did you mean you want achieve duty control rather than phase control mode? Does your waveform indicate that you achieved phase control mode, or you did not achieve HRPWM at all?

    When you write the code make sure to clear all bits first, EPwm1Regs.HRCNFG.all = 0x0; Also, why do you have Epwm6.regs, and then Epwm1.regs used?

  • Hello Stevan

    Thank you. 

    First of all, we would like to check if the HRPWM is set.
    As for the confirmation method, I was trying to confirm with the procedure of ① ②.
    ①Create the same PWM using Epwm6 COMPA and COMPB
    ②implement HR functionality only in Epwm6 comb.
    Only the rising edge is set to delayed as shown in the figure below

    COMPA has no high resolve. COMPB has.

    As of now, we have confirmed that it has been successfully implemented up to ①.
    ② is not I think.

    Please tell us the register setting items necessary to achieve ②.

    To answer your question:

    did you mean you want achieve duty control rather than phase control mode?

    We want to do duty control for ②. Is that correct?

    Does your waveform indicate that you achieved phase control mode, or you did not achieve HRPWM at all?

    Both COMPA and COMPB are 50% Duty same in-phase waveform.

    make sure to clear all bits first, EPwm1Regs.HRCNFG.all = 0x0;

    Thank you and we tried, but does not work.

    why do you have Epwm6.regs, and then Epwm1.regs used?

    HR function was checked with epwm6, but the following wording was found in the HRPWR register description in the reference manual, so epwm1 was set just in case.

    Please give us some advice.

    Regards,

    Jieyu

  • Hello,

    Do you have to use ePWM6 or you can use ePWM1 as well to achieve this? I am just curious if it would change anything since registers seem okay.

    We want to do duty control for ②. Is that correct?

    The MEP can be programmed to provide precise position control on the rising edge (RE), falling edge (FE) or both edges (BE) at the same time. FE and RE are used for power topologies requiring duty cycle control (CMPA or CMPB high-resolution control), while BE is used for topologies requiring phase shifting, (TBPHS). So, you want just to modify RE which refers to duty control.

  • Hello, I gave another look to your inquiry. Do you use EPWM Channel A or Channel B to generate regular EPWM? If you use Channel A (EPWM6A) you can only access CMPAHR register and for Channel B (EPWM6B) you can only access CMPBHR register.

    Therefore, you have to use EPWM6B so your code and HRPWM works properly. 

  • Thank you Stevan

    We have additional questions:

    1.Is it OK to set COMPHR to a value greater than 1TBCLK? Specifically, TBCLK = 100 MHz (1 clock = 10 ns) Assuming MEP step = 150ps, per clock The number of MEP steps is 10ns/150ps = 66. Is it OK to set COMPHR to a value greater than 67? (Even if 67 or more is set, is it possible to delay the setting?)

    2.Should I always use the SFO() function when using HRPWM?

    3.Can HRPWM be realized only by setting COMPHR registers and HRCNFG registers?

    And if possible, we still want to discuss with you/your team around 30 minutes for better understanding.

    Do you have time 0203/0204/0205/0206 afternoon work please?

    Regards,

    Jieyu

  • Hello,

    1. The value of COMPHR is going to follow the formula: (frac(PWMDuty*PWMPeriod)*MEP_ScaleFactor + 0.5) <<8); frac means fractional part, shifting is to move the value to the high byte of COMPHR. The value of COMPHR, which ranges from 1 - 255 before bit shifting, is going to be less than MAX MEP steps in this case 66. There is an example in device TRM how to do the calculations 19.15.1.5.2 Scaling Considerations, and there is integrated HRPWM Timing calculator in Sysconfig.

    2. It is recommended to use the SFO() function because it enables auto-conversion mode. If AUTOCONV is not set, the above formula must be performed by software. The MEP scale factor (MEP_ScaleFactor) varies with the system clock and DSP operating conditions. TI provides an MEP scale factor optimizing (SFO) software C function, which uses the built-in diagnostics in each HRPWM and returns the best scale factor for a given operating point.

    3. HRPWM is configured by programming the HRCNFG register in that particular ePWM module's register space. If you want to just correct rising or falling edge of pwm signal giving it HR feature then COMPHR and HRCNFG are sufficient.