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.

How to configure a 10 KHz PWM signal

Other Parts Discussed in Thread: TMS320F28027

Hi everyone, i'm a beginer,  i have decided to ask in my own post about this topic.

In order to undertake my exersise, the following changes on register are made:

EPwm1Regs.TBTCR=0x0000; // Clear timer counter

and this is the cuestion:

EPwm1Regs.TBPRD=6000;// <== to set the timer period at T=1/10KHz

6000? is  a correct value to configure 10 KHz PWM1???

There is an example in page (101/141) of spruge9e.pdf

Am I right?

if i supose the base Clock period of my microcontroller is (1/60MHz)

the calculatios is just (60MHz divided by 6000=10KHz)???, Am I right?

and is just to put EPwm1Regs.TBPRD=6000;// <== to set the timer period at T=1/10KHz ¿?¿?

help me please, i have to finish my exercises in septembre 2nd,  i hope so..

I have also taken into account the following table:




  • Hi,

    Here is how you calculate PWM TBPRD value:

    For eg. Given info: Clock speed = 60MHz, PWM frequency required - 10KHz then

    1. Tpwm = 1/10KHz = 0.0001

    2. Tbclk = 1/150Mhz = 1.67E-08

    3. TBPRD = (Tpwm/(2*Tbclk)) = 2994 or 3000 whichever works for you :)

    Regards,

    Gautam

  • Really thanks Gautam for your explanation, i think i finally understood, but why Tbclk= (1/150MHz), i saw in the documentation of my Piccolo - TMS320F28027 that the frecuency clock is "Up to 60MHz", is for this reason that you put "Tbclk = 1/150Mhz = 1.67E-08" ??

    My question is:

    For Default Piccolo working at  150 MHz ????

    I have considered the following caracteristics of my Piccolo:

  • Hi,

    Actually I use Tbclk = 1/150Mhz = 1.67E-08 for F28335 controller. Whereas F28027 as given will support upto 60Mhz.

    By default, controller will work according to the documentation as given above.

    Regards,

    Gautam