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.
Original question:
TMS320F280049: 如何使用280049或28034芯片的EPWM模块输出单个PWM波,并且可软件重复发送需要个数
希望使能后计数到一个周期时,自动停止计数。 每次使能只计数一个周期。
能详细说一下你的需求吗?
就是PWM的计数器TBCTR = TBPRD后。TBCRT重置为0要保持停止状态,需要一个重新使能再启动一次
外设本身是没有这个功能的。可以通过中断来实现
EPwm1Regs.TBCTR = 0;
EPwm1Regs.TBPRD = 60000; //将CTR赋值为0 给PRD立刻更新一个周期的值
EPwm1Regs.TBCTR = 1; EPwm1Regs.TBPRD = 0; //CTR给1 PRD给0 当计数溢出为0时,影子寄存器0更新为周期值 是不是就停止了
上面连续写4行代码,可以实现单脉冲吗?
不能