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.

F28377D HRPWM Location



Hello,

I have a question about the HRPWM module in the ePWM modules, because I am experiencing some strange behaviour.

Where is the mep located within the ePWM module?

Because I have the following situation:
- I am using the pwm module in up/down mode
- Only output A is used.
- The output is set with CAU, and cleared with CBU
- CMPA is configured with a low value, and CMP with a high value.
- The edgemode is set to falling edge.

I would like to have high resolution capability on the falling edge of the pwm.
Therefore I thought I needed to set the CMPBHR register with the appropriate value.
But when I set the CMPBHR register, nothing happens.

But when I set the CMPAHR register, the falling edge of the pwm changes.

Is it only possible to use the CMPAHR register for the A output. And visa-versa the CMPBHR register for the B output?

Thanks in advance,

Erik

  • Erik,

    That's correct.
    CMPAHR value will impact PWMA output. CMPBHR will impact PWMB output.
    For your case you can simply use CAU to control falling edge.

    -Bharathi.

  • Ok for this problem it is easy to use the CAU to clear the PWM output. That was also my solution, but I wanted to make sure this is normal behaviour.


    The second problem I have now is the following:

    I am using a second PWM channel and this channel uses the same up-down counter mode and also output A. But this channel uses the CAD to set the PWM and the CBD to clear the PWM. Where I want to control the rising edge of the PWM with high resolution.

    When I enter a larger value in the CMPA register, the rising edge moves to the left (happens earlier in time), because of the down slope of the counter. This is normal.

    But when I fill the complete CMPA register (including the CMPAHR), with a single 32-bit write instruction. For example the old value was 407.0(IQ16 format) with the new value 407.5 (IQ16 format). Then the rising edge moves to the right, thus later in time.

    Therefore it is my conclusion to say that the HRPWM module only stretches the output of the PWM module with the number of bits set in the CMPxHR register. Is this the case for the HRPWM module? Because I am looking at the documentation in the technical reference manual, but I cannot get this conclusion from the documentation.

    Erik

  • Erik,

    Regarding your second observation - That's also correct. Value written in *HR is always a applied as delay - hence moving the edge to later in time.
    For your case - you can write 406.5

    -Bharathi.

  • Ok, that clarifies a lot.


    For software design purposes, I would like to know where in the ePWM architecture the HRPWM is applied. Is it applied before the dead band, pwm chopper, trip zone, or even after the trip zone just before the output?

    See the image for the block diagram of the HRPWM. Here it is not clear where the HR is applied.

  • In terms of signal traversing through various sub-blocks -
    You can view it as HRPWM after all the blocks but before tripzone. So, Trip actions are final that determine what comes out of EPWM.

    -Bharathi.
  • Hi All,

    Is this also the case for the high resolution DeadBand? Is this also applied just before the Tripzone module?

    And in which order are the HRPWM and DBHRPWM applied? Is PWMA first streched by PWMAHR and then streched by DBHRA?

    Best regards,

    Tjarco Boerkoel

  • Yes. Tripzone module acts after deadband HR as well. 
    Deadband HR also is a delay applied to a chosen edge, similar to CMPA/B HR.
    Order of PWMAHR and DBHR is not relevant as the effect is combined delay in the end. 

    -Bharathi.