1、触发选择全部或者其中一路 如:EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 15;
2、配置的是obc模式,
结果
在执行以下语句时,EPwm1Regs.TZFLG 不会清0,查了比较器1-4 的Cmpss3Regs.COMPSTS.bit.COMPHLATCH 高和低比较都为0..
EPwm1Regs.TZCLR.bit.CBC = 1;
EPwm1Regs.TZCLR.bit.DCBEVT2 = 1;
EPwm1Regs.TZCLR.bit.DCAEVT2 = 1;
执行下来,EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL 所选的通道 都为0,但是EPwm1Regs.TZFLG却不为0
user6226738:还有 EPwm1Regs.TZCBCCLR.bit.DCAEVT2 = 1;EPwm1Regs.TZCLR.bit.DCAEVT2= 1;这两句有什么区别
1、触发选择全部或者其中一路 如:EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 15;
2、配置的是obc模式,
结果
在执行以下语句时,EPwm1Regs.TZFLG 不会清0,查了比较器1-4 的Cmpss3Regs.COMPSTS.bit.COMPHLATCH 高和低比较都为0..
EPwm1Regs.TZCLR.bit.CBC = 1;
EPwm1Regs.TZCLR.bit.DCBEVT2 = 1;
EPwm1Regs.TZCLR.bit.DCAEVT2 = 1;
执行下来,EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL 所选的通道 都为0,但是EPwm1Regs.TZFLG却不为0
Aiden:
回复 user6226738:
1)EPwm1Regs.TZFLG不能清0:TZCLR寄存器是受保护的 TZCLREALLOW,你解锁了吗?
2)EPwm1Regs.TZCBCCLR.bit.DCAEVT2 = 1;EPwm1Regs.TZCLR.bit.DCAEVT2 = 1; 这是清楚不同的FLAG。
1、触发选择全部或者其中一路 如:EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 15;
2、配置的是obc模式,
结果
在执行以下语句时,EPwm1Regs.TZFLG 不会清0,查了比较器1-4 的Cmpss3Regs.COMPSTS.bit.COMPHLATCH 高和低比较都为0..
EPwm1Regs.TZCLR.bit.CBC = 1;
EPwm1Regs.TZCLR.bit.DCBEVT2 = 1;
EPwm1Regs.TZCLR.bit.DCAEVT2 = 1;
执行下来,EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL 所选的通道 都为0,但是EPwm1Regs.TZFLG却不为0
user6226738:
回复 Aiden:
1、解锁了:配置如下 EALLOW; EPwm2Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 0x0f; EPwm2Regs.DCBHTRIPSEL.bit.TRIPINPUT4 = 1; EPwm2Regs.DCBHTRIPSEL.bit.TRIPINPUT5 = 1; EPwm2Regs.DCTRIPSEL.bit.DCAHCOMPSEL = 0x0f; EPwm2Regs.DCAHTRIPSEL.bit.TRIPINPUT4 = 1; EPwm2Regs.DCAHTRIPSEL.bit.TRIPINPUT5 = 1; EPwm2Regs.TZDCSEL.bit.DCBEVT2 = TZ_DCBH_HI; EPwm2Regs.DCBCTL.bit.EVT2SRCSEL = DC_EVT2; EPwm2Regs.DCBCTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC; EPwm2Regs.TZDCSEL.bit.DCAEVT2 = TZ_DCBH_HI; EPwm2Regs.DCACTL.bit.EVT2SRCSEL = DC_EVT2; EPwm2Regs.DCACTL.bit.EVT2FRCSYNCSEL = DC_EVT_ASYNC; EPwm2Regs.TZSEL.bit.DCBEVT2 = 1; EPwm2Regs.TZSEL.bit.DCAEVT2 = 1; EPwm2Regs.TZCLR.bit.CBC = 1; EPwm2Regs.TZCLR.bit.DCBEVT2 = 1; EPwm2Regs.TZCLR.bit.DCAEVT2 = 1; EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_LO; EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO; EPwm2Regs.TZCTL.bit.DCBEVT2 = TZ_FORCE_LO; EPwm2Regs.TZCTL.bit.DCAEVT2 = TZ_FORCE_LO; EDIS; 2、配置为cbc时,EPwm1Regs.TZFLG和EPwm1Regs.TZCBCFLG 对应的DCBEVT2 都会置1吗
1、触发选择全部或者其中一路 如:EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL = 15;
2、配置的是obc模式,
结果
在执行以下语句时,EPwm1Regs.TZFLG 不会清0,查了比较器1-4 的Cmpss3Regs.COMPSTS.bit.COMPHLATCH 高和低比较都为0..
EPwm1Regs.TZCLR.bit.CBC = 1;
EPwm1Regs.TZCLR.bit.DCBEVT2 = 1;
EPwm1Regs.TZCLR.bit.DCAEVT2 = 1;
执行下来,EPwm1Regs.DCTRIPSEL.bit.DCBHCOMPSEL 所选的通道 都为0,但是EPwm1Regs.TZFLG却不为0
user6226738:
回复 Aiden:
比较是滤波后直接传给PWM,调试窗口可以看到compsts的翻转,翻转为1时cbc状态转为1,但是翻转为0时cbc不会复位还是为1