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.

TMS320F280049C: TMS320F280049 HRPWM 设置高分辨率周期和移相,频率无法实时被改变?

Part Number: TMS320F280049C

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#define MIN_HRPWM_PRD_PERCENT (20.0003f)
void changeHZ(double zTemp)
{
uint32_t compCount = 0UL;
double iTemp = 0.0f;
uint32_t aTemp = 100000UL;
uint32_t xTemp = 0UL;
double yTemp = 0.0f;
iTemp = aTemp / zTemp;
xTemp = floor(iTemp); //
yTemp = iTemp - xTemp; //
compCount=yTemp*256;
EPwm1Regs.TBPRD =xTemp-1;
EPwm1Regs.TBPRDHR = compCount<<8;
EPwm3Regs.TBPRD =xTemp-1;
EPwm3Regs.TBPRDHR = compCount<<8;
}
void main(void)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1,配置PWM1+PWM3的HRPWM输出,PWM3对PWM1移相

2,从20.0003kHZ开始加,每次加0.0001KHZ(也就是0.1HZ)
3,断点调试,示波器抓取频率,会正常改变:
4,延时低于800000us,示波器抓取频率,不按0.1HZ跳变 :

请问这是何故?