在配置F280049的ePWM模块时,按照以下步骤:
1. enable ePWM moudule clocks in the PCLKCRx register
2. set TBCLKSYNC = 0
3. Configure ePWM modules
4. Set TBCLKSYNC = 1
Configure ePWM modules步骤主要包括以下配置:
EPwm5Regs.TBPHS.bit.TBPHS = 0;
EPwm5Regs.TBCTL.all = 0XA012;
EPwm5Regs.TBCTL.bit.PRDLD = 1;
EPwm5Regs.TBPRD = 500;
EPwm5Regs.CMPCTL.bit.SHDWAMODE = 1;
EPwm5Regs.CMPCTL.bit.SHDWBMODE = 1;
EPwm5Regs.CMPA.bit.CMPA = 1000;
EPwm5Regs.CMPB.bit.CMPB = 1000;
EPwm5Regs.AQCTLA.bit.CAU = 1;
EPwm5Regs.AQCTLA.bit.CAD = 2;
EPwm5Regs.AQCTLB.all = 0x0600;
EPwm5Regs.DBCTL.all = 0x0000;
EPwm5Regs.DBFED.bit.DBFED = 100;
EPwm5Regs.DBRED.bit.DBRED = 100;
然而当执行以下语句
EALLOW;
CpuSysRegs.PCLKCR0.bit.TBCLKSYNC = 1;//20200923:cedar: Enable EPWM timer counter
EDIS;
4.5us之后,ePWM5A对应的GPIO,立马触发了一个上升沿信号。这个上升沿信号不属于设置范围内,应该如何避免这个上升沿信号出现。
后续测试:
将配置语句中的EPwm5Regs.AQCTLA.bit.CAD = 2;注释掉之后,执行TBCLKSYNC = 1后,ePWM5A没有出现上升沿信号。
请问为什么执行TBCLKSYNC = 1瞬间,会触发ePWM5产生一个上升沿信号
Nancy Wang:
请到c2000论坛咨询。
e2echina.ti.com/…/
,
user6531244:
好的,多谢