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.

TMS320F280049: Clarify where to reset COMPDAC ramp generator?

Part Number: TMS320F280049

Champs,

I am asking this for our customer.

The customer is very confused about the description sec 16.4 in the TRM (SPRUI33A) on ramp reset.

It says "

On the rising edge of the selected EPWMSYNCO; RAMPMAXREFA, RAMPDECVALA and RAMPDLYA
are loaded with their shadow registers. RAMPSTS is loaded with RAMPMAXREFS and starts
decrementing when RAMPDLYA counter reaches zero."

From it, they think RAMPSTS starts decrementing on EPWMSYNCO.

However, they have done some labs and the waveform and expected timing diagram are showed below.

In the code, they use CMPB to generate EPWMSYNCO.

and 

void Init_CMPSS(void)
{
EALLOW;
Cmpss1Regs.COMPCTL.bit.COMPHINV = 0;
Cmpss1Regs.COMPCTL.bit.COMPHSOURCE = 0;
Cmpss1Regs.COMPDACCTL.bit.RAMPSOURCE = 0; // EPWM1SYNCO
Cmpss1Regs.COMPDACCTL.bit.DACSOURCE = 1; // Uses ramp generator
Cmpss1Regs.RAMPMAXREFS = 0xFFFF; // 3.3V
Cmpss1Regs.RAMPDECVALS = 2; // 2 / 65535 * 3.3V = 10.071 mV/us

Cmpss1Regs.COMPCTL.bit.COMPDACE = 1;
EDIS;
}

The result appears to show the RAMPSTS register of the ramp generator starts decrementing when the time-base counter of EPWM1 equals to TBPRD rather than the rising edge of EPWMSYNCO. 

Do you have any comment why the result shows the RAMPSTS register of the ramp generator starts decrementing when the time-base counter of EPWM1 equals to TBPRD rather than the rising edge of EPWMSYNCO?

Would you please help us clarify?

Wayne Huang

  • Wayne,

    I think that there might be an error in the document and that the Ramp Generator logic is looking for the PWMSYNC signal configured by the HRPCTL register rather than the EPWMSYNCO signal.

    The module expert is currently out of the office and will look into this further when he returns.

    -Tommy

  • Hi Wayne,

    I'm looking into this and should have a response for you by the end of the week.
  • Hi Wayne,

    Thanks for your patience. I have confirmed that there is indeed a documentation error and we will be updating the documentation in the next release. As Tommy rightly pointed out, the SYNC to the CMPSS is not EPWMSYNCO. It is configured by the "PWMSYNCSEL" and "PWMSYNCSELX" fields of the HRPCTL register. The reason why you are seeing RAMPSTS decrement on TBPRD is because on reset, the SYNC to the CMPSS is generated on TBCTR=TBPRD.
  • Frank, Tommy

    Thank you.


    Wayne