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.

TMS320F28069: Query regarding T_PWM in 28069 processor

Part Number: TMS320F28069


Hi,

I am working on TMS320F20869 processor.  I want T_pwm = 8.3333 ms. For this, I had done the following coding.

CASE-1:

TBPERIOD = (T_pwm*90MHz) / (12) = 62500;

EPwm1Regs.TBCTL.bit.CLKDIV = 0x011 = 8

EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0x01 = 2

TBCLK = (8*2)/90MHz = 1.77778*10^-7;

In DSO I observed T_PWM value as 2.775 ms which is not correct

CASE-2:

TBPERIOD = (T_pwm*90MHz) / (12) = 62500;

EPwm1Regs.TBCTL.bit.CLKDIV = 0x0100 = 16

EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0x01 = 2

TBCLK = (16*2)/90MHz = 3.55*10^-7;

In DSO I observed T_PWM value as 1.385 ms which is not correct

 

CASE-3:

TBPERIOD = (T_pwm*90MHz) / (12) = 62500;

EPwm1Regs.TBCTL.bit.CLKDIV = 0x0101 = 32

EPwm1Regs.TBCTL.bit.HSPCLKDIV = 0x01 = 2

TBCLK = (32*2)/90MHz = 7.11*10^-7;

In DSO I observed T_PWM value as 2.775 ms which is not correct

 

In all the 3 cases, I am not getting the required T_pwm value, I changed the CKLDIV values in all the 3 cases. Case-1 and case-3 I am getting the same result, and in case-2 it is exactly half of the case-1 (or) case-3 value.  I can not increase the TBPRD value more than 62535 due to 16-bit constraint.

Can any one suggest me how to get the required T_PWM value.

Thank you

 

  • While I didn't check your math or implementation, you simply need to slow down your clock. Maximize TBCLK.CLKDIV, if you have maximized all of the dividers between SYSCLK and the TBCLK and still have not reached your value, then you will need to slow down SYSCLK.

    Please double check the value you wrote in case 3 and that no other factors changed using the memory browser . Case 3 should not be the same frequency as case 1.

    One alternative is to use the eCAP module for these slow signals, it has 32 bit counters and there for can have a much longer period.

    Regards,
    Cody 

  • Hi,

    Thank you for your reply. The issue got resolved. I made a mistake in hexadecimal declaration.

    EPwm1Regs.TBCTL.bit.CLKDIV = 0x011 = 8  /////  Old one (wrong)

    EPwm1Regs.TBCTL.bit.CLKDIV = 0x03 = 8  /////  New one

    Thank you