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.

CCS/LAUNCHXL-F28379D: HRPWM - MEP scale factor in the example hrpwm_slider

Part Number: LAUNCHXL-F28379D

Tool/software: Code Composer Studio

Hello,

my problem is, if I change the value in "EPwm1Regs.CMPA.bit.CMPAHR", the output "PWM1A" on the board but does not change.

That's why I want to ask:

Does not in the example "hrpwm_slider" need to define the MEP scale factor in the register HRMSTEP?

If so, where can I find this assignment?

  • Okay in that example, open up the Expressions window in the debug perspective and add the variable DutyFine. Make sure to enable Auto-Update so you can see its value in real time. Run your core, then click and update the DutyFine value. If you just update the CMPA, CMPAHR, they will be overwritten by the duty fine variable. Then you can see the effects in the waveform.

    To answer your other question, no. The HR values can be used without technically measuring them. The more you put in CMPxHR, the more delay elements you turn on.

    Now to use this more professionally, you can use the SFO to measure how many HR Elements fit into one EPWM (NON HR) steps (meaning how much delay does each element actually create), then on top of that enable auto conversion and use the HRPWM to create PWM signals that have for-example 52.5% duty cycle. For an example that does this, check out the hrpwm examples with SFO.

    Nima Eskandari

  • EPWM1: CMPAHR = 0x28 and EPWM2: CMPAHR = 0x0

    But the output signals PWM1A and PWM2A have the same length:

    Why is it so?

  • Please review the section in the TRM called "Duty Cycle Range Limitation". Your CMPA value is 1, you are violating this.
  • Hello Nima Eskandari,
    thank you very much for your help.

    Best regards,
    Martin
  • Anytime. Please post a new thread if you had related questions by choosing + Ask a related question button at the top right.