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.
您好!piccolo高精度PWM有几个问题咨询下,非常感谢您!
1)SPRUGE8E手册中关于CMPAHR的计算:
Step 2: Fractional value conversion for CMPAHR register
CMPAHR register value = (frac(PWMDuty*PWMperiod)*MEP_ScaleFactor+0.5
) << 8; frac means fractional part
= (frac( 19.4)* 93 + 0.5) <<8; Shift is to move the value
as CMPAHR high byte
= (( 0.4 * 93 + 0.5) << 8)
= ( 37.2 + 0.5) <<8
= 37.7*256 ; Shifting left by 8 is the same as multiplying
by 256.
= 9651
CMPAHR value = 25B3h; CMPAHR value = 25B3h, lower 8 bits will be
ignored by hardware.
1)请问MEP_ScaleFactor这个值是通过SFO_TI_Build_V6.lib库函数中通过
系统时钟的不同以及DSP运行状况获得的吗?这个地方93(微调步长180ps)只是一个假定值吗?
2)如果我在PWM初始化时赋值EPWM1Regs.HRMSTEP=0x0080,那么这个值最终还是被SFO_TI_Build_V6.lib库函数获取的
EPWM1Regs.HRMSTEP=MEP_ScaleFactor覆盖掉吗?非常感谢您!