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.

TMS320F28377S: Floating frequency PWM ( Launchpad F28377S)

Part Number: TMS320F28377S

Hi,

I want to have a frequency control of a PWM in order of less than 1 Hz, for example 0.1 Hz.

I wanna move from 20000 to 20000.1 for example. Always with fixed duty cycle (50%).

But how can I do that if the equation for the PRD register is:

PRD = MCU_Freq / (2 * 2 * Freq)

in which MCU_Freq = 200 Mhz, Freq = desired frequency and the '2*2' part is due to the up-down mode, and the PRD is actually an unsigned integer.

Anyone can help me with that? I really appreciate.

  • Hi Vinicius,

    I am sorry but this would not be possible with current PWM. With frequency of 0.1Hz or 10s the PRD register would not be sufficient to hold such a value. Since TBPRD has only 16 bits.

    Also for TMS320F28377S in order to calculate the TBPRD you can use the following equation from the TRM

    Also note that the TBCLK is different for this device. The clock being used for epwm is EPWMCLK which is SYSCLK/2. 

    Best regards,

    Ryan Ma