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.

有关TMS320F28338 PWM模块



现在想用28335的EPWM产生特定频率的方波,但是查到 TBPRD寄存器的取值范围为0x0000--0xFFFF,也就是说 TBPRD的最大值可以设为65536?请问是这样的吗?假如我想得到更大周期的PWM波,比如20ms,应该怎么做?

  • TBPRD只是EPWM周期设置寄存器,TBPLD是计数器,他的输入是EPWM CLK, 当TPPLD的值等于TEPRD就会清零或者在updown模式下变成下降计数。举例:如果你要设置20ms,那就需要先把PWM的输入时钟分频,因为150M输入,比如128分频,就是1.175M的输入时钟。那设置TBPRD为23438就可以了。

    TBCLK = SYSCLKOUT / (HSPCLKDIV × CLKDIV),

    CLKDIV 位可以设置以下值
    000 /1 (default on reset)
    001 /2
    010 /4
    011 /8
    100 /16
    101 /32
    110 /64
    111 /128

    HSPCLKDIV 可以设置以下值
    000 /1
    001 /2 (default on reset)
    010 /4
    011 /6
    100 /8
    101 /10
    110 /12
    111 /14

  • 解决了,多谢!