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.

TMS320F280039C-Q1: HRPWM for phase control

Part Number: TMS320F280039C-Q1

Tool/software:

Hi experts,

I ask this question for my customer. They want to use HRPWM to realize phase control and period control.

1. But in my understanding, this two mode can't be enable in HRPWM module at the same time, but I found below thread: TMS320F28374D: Control for both Duty Cycle and Phase shift - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums, I'm not sure if I have a misunderstanding, it can be realized?

2. Just for phase control, I found some description in TRM, so if we need to modify the value of TBPHSHR, we need to modify the TRREM directly?

Could I follow these two thread? I'm not sure in 280039, HRPWM module is same with these chips.

 https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/858613/tms320f28379d-usage-information-on-trrem-register-for-periodic-hr-phase-update

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1407788/tms320f28p650dk-configuration-of-phase-and-period-control-mode-for-hrpwm?tisearch=e2e-sitesearch&keymatch=HRPWM%20phase%20control#

3. Is FSO is must added in HRPWM application?

4. I'm not sure if I have right understanding about HRPWM, for COMPAHR, I understand it will influence the edge in no HRPWM mode AQ waveform, that means it function will take after AQ subsystem. But for TBPRDHS and TBPHSHR, when it make a influence to EPWM waveform? Is it correct the TBCTR when it equal to zero or TBPRD? But in our diagram, it seems that it will make an influence still after the AQ subsystem.

BRs

Shuqing

  • Hi Shuqing,

    1) Both cannot work at same time since either CMPHR/PRDHR controls edge position or PHSHR controls edge position

    2) When HRPE=1 use TRREM, otherwise use TBPHSHR as mentioned in the thread as well

    Is FSO is must added in HRPWM application?

    Yes SFO is required in HR operations. refet to 20.15.1.7 Scale Factor Optimizing Software (SFO) in manual for more details

    I'm not sure if I have right understanding about HRPWM, for COMPAHR, I understand it will influence the edge in no HRPWM mode AQ waveform, that means it function will take after AQ subsystem. But for TBPRDHS and TBPHSHR, when it make a influence to EPWM waveform? Is it correct the TBCTR when it equal to zero or TBPRD? But in our diagram, it seems that it will make an influence still after the AQ subsystem

    HR works on micro edge positions meaning it places/moves in micro edge's as per the configurations so there is no sequence as to what happens first or later. The HRPWM is based on micro-edge positioner (MEP) technology. MEP logic is capable of positioning an edge very finely by sub-dividing one coarse system clock of a conventional PWM generator.

  • Hi Bhatt,

    Thank you for you reply.

    And thanks for your demo provided in this thread: TMS320F280039C: High-Resolution Pulse Width Modulator :- Issue with using TBPHSHR register for High-Resolution Phase shift - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums

    I can generate the desired high-solution phase shift based on this demo.

    Configuration is below:

    up-down mode,

    EPWMCLK=120MHz,

    EPWM period = 60KHz

    duty = 50%

    PHSDIR = 1;

    But I still need to confirm below question:

    1. When I enable the auto-conversion mode, I noticed that the value of HRMSTEP is always 0, is it normal? Because according to the description in TRM, I think the HRMSTEP will be updated every EPWMCLK

    2. I don't know how the SFO calibration module will work? It will always work after it be called once or it will just work once after it be called? I asked this because I don't know how many times I need to call this. Is it need to call below code in an infinite loop? Or just need to call in once in init? Or Is it need to be called when customer need to calibrate the HRMSTEP?

    3. I can use the thread(TMS320F280049: HRPWM TBPHS and TBPHSHR move waveform in opposite directions - C2000 microcontrollers forum - C2000Tm︎ microcontrollers - TI E2E support forums) you mentioned to calculate the value of TBPHSHR, but I still need to double check that when we enable the auto-conversion mode, this module will automatically adjust the MEP steps that will let when TBPHSHR = 255, HR will phase 1 EPWMCLK. That means when I enable the auto-conversion mode, the MEP step size will not be fixed as 150ps but will change following the EPWMCLK?

    4. Is it have requirement for the vison of SFO library, that means is SFO_v8_fpu_lib_build_c28_driverlib.lib can meet requirement?

    5. In my understanding, the value of TRREM will change following the TBPHSHR, but TRREM is always 0, is it normal?

    BRs

    Shuqing

  • Hi,

    I asked this because I don't know how many times I need to call this.

    SFO needs to be called periodically

    s it have requirement for the vison of SFO library,

    SFO function runs based on this library provided by TI so its needed.

    In my understanding, the value of TRREM will change following the TBPHSHR, but TRREM is always 0, is it normal?

    Is HRPE enabled ? If not then yes TRREM can be zero