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.
28335的epwm的时基模块TBCTR用的是哪个定时器啊?能人为关闭和使能吗?换句话说,能在程序里任意时刻人为关闭或者使能pwm的载波呢?
或者说某一时刻我在开启使能TBCLKSYNC,开启载波三角波的时候,SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1,有什么办法能让TBCTR重新从0开始计数?我试了装初值如下:
EALLOW;
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;// Enable TBCLK within the ePWM
EDIS;
EPwm1Regs.TBCTR = 0x0000;
EALLOW;
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;// Enable TBCLK within the ePWM
EDIS;
但是好像不行
SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;// Enable TBCLK within the ePWM
这个就是用来关时钟的,但是会关掉所有PWM的时钟。使能前如果要计数器清零,则直接写0即可。
ERIC