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.

TMS320F280049C: HRPWM AQ settings

Part Number: TMS320F280049C
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I'm looking for some clarification on the limitations of the action qualifier when running in up-down count mode and with the MEP controlling both edges. Syscfg states (and also mentioned in other forum posts) that it is necessary for CMPA up = set and down = clear on EPWMxA, and the same with CMPB on EPWMxB. There is, however, no explanation of why. I have experimented with using CMPA on EPWMxB, swapping the up event for clear and down event for set, and as far as I can tell the signal is exactly what I would expect it to be, but the warning message remains in the syscfg configurator nevertheless.

Am I just not looking closely enough to see the error that such a setup would cause, and what is the reason for this very specific configuration? Apologies if this is hidden somewhere in the TRM, but I have already read through the HRPWM section and can't seem to find an explanation.

Thanks,

Tom

  • Hi Tom,

    The placement of action qualifiers for HRPWM controlling both edges is explained a bit in this FAQ E2E: 

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/746906/faq-hrpwm-in-up-down-counter-mode-will-only-load-user-cmp-shadow-registers-on-ctr-zero 

    Essentially, when trying to control both edges of the PWM, the HR module internally needs to recalculate the values needed to adjust each edge individually. In this sense, you need to have the action qualifiers on CMPA-up/down so the PWM is centered on PRPD so that it allows for those internal calculations, but you are asking if you absolutely have to have "high" on CMPA-up and "low" on CMPA-down versus "low on CMPA-up and "high" on CMPA-down - that is the confusion, correct? Let me reach out about the sysconfig warning source on this.

    Best Regards,

    Allison

  • Hi Allison,

    Yes, that is the essential question. If I could have CMPX-up drive the signal low, and vice versa, then this would achieve what I want.

    Thanks,

    Tom

  • Hi Tom,

    I believe the main point of emphasis is the PWM should be centered on PRD in up-down count mode so that the CTR = PRD event is used for specific internal logic inside the HRPWM module in order to allow for HR edge placement on both the rising and falling edge. I'm in the process of getting clarity on this note.

    Another thought is you could also try leveraging the deadband module to invert your signal using DBCTL.POLSEL:

    I'll keep you updated, but let me know if this is of interest as well.

    Best Regards,

    Allison

  • Hi Allison,

    I'm currently using the deadband module to invert the secondary signal (whilst also adding a deadband), but this has the side effect of having the B signal high at standby (using software force A low), which is what I'm trying to avoid. If there's a way to achieve an active high complementary output but also have the ability do keep both signals low, then this is what I'm looking for.

    Thanks,

    Tom

  • Hello Tom,

    Ah yes I see the problem. The main issue that the warning is trying to be sure you avoid is having a PWM action occur on the counter = 0 or counter = period events. From my understanding, you should be fine doing the opposite actions on CMPAU and CMPAD. The main difference is you need to also recognize that your HR duty control will behave the opposite of how you would expect with set on CMPAU and clear on CMPAD in terms of increasing/decreasing the duty using HR edge placement, hence why the warning suggests set on CMPxU, clear on CMPxD. I'll let you know if I hear otherwise from design.

    Best Regards,

    Allison

  • Hi Tom,

    Sorry for the delay. Based on the register definition of AQCTLA and AQCTLB, CMPxU and CMPxD have separate control to set or clear the PWM. The same is implemented in the design as well from design team side. I will adjust the SysConfig warning accordingly for future releases Slight smile

    Best Regards,

    Allison