我是在epwm的中断里面读取EPwm1Regs.CMPA.half.CMPA和EPwm1Regs.TBCTR的值,然后输出DA用示波器观察,代码如下(中断里面):
comp=EPwm1Regs.CMPA.half.CMPA;
counter11=EPwm1Regs.TBCTR;
DA0= comp/15000;
if(DA0>=0.9999)
DA0=0.9999;
if(DA0<=-0.9999)
DA0=-0.9999;
*DA_ADD0 = DA0 * 2048+2048;
DA1= counter11/15000;
if(DA1>=0.9999)
DA1=0.9999;
if(DA1<=-0.9999)
DA1=-0.9999;
*DA_ADD1 = DA1 * 2048+2048;
但是示波器显示的都是一条直线,教问各位前辈是怎么回事呢
Brian Wang0:
先尝试用CCS的Graph观察是否正常
我是在epwm的中断里面读取EPwm1Regs.CMPA.half.CMPA和EPwm1Regs.TBCTR的值,然后输出DA用示波器观察,代码如下(中断里面):
comp=EPwm1Regs.CMPA.half.CMPA;
counter11=EPwm1Regs.TBCTR;
DA0= comp/15000;
if(DA0>=0.9999)
DA0=0.9999;
if(DA0<=-0.9999)
DA0=-0.9999;
*DA_ADD0 = DA0 * 2048+2048;
DA1= counter11/15000;
if(DA1>=0.9999)
DA1=0.9999;
if(DA1<=-0.9999)
DA1=-0.9999;
*DA_ADD1 = DA1 * 2048+2048;
但是示波器显示的都是一条直线,教问各位前辈是怎么回事呢
user4671895:
回复 Brian Wang0:
你好Weiqi,之前我也尝试用CCS的Graph来观察,但是不清楚是不是参数设置的问题,出来的波形,完全不对,所以才想用DA输出来观察的。
我是在epwm的中断里面读取EPwm1Regs.CMPA.half.CMPA和EPwm1Regs.TBCTR的值,然后输出DA用示波器观察,代码如下(中断里面):
comp=EPwm1Regs.CMPA.half.CMPA;
counter11=EPwm1Regs.TBCTR;
DA0= comp/15000;
if(DA0>=0.9999)
DA0=0.9999;
if(DA0<=-0.9999)
DA0=-0.9999;
*DA_ADD0 = DA0 * 2048+2048;
DA1= counter11/15000;
if(DA1>=0.9999)
DA1=0.9999;
if(DA1<=-0.9999)
DA1=-0.9999;
*DA_ADD1 = DA1 * 2048+2048;
但是示波器显示的都是一条直线,教问各位前辈是怎么回事呢
Emma Wang:
回复 user4671895:
请问您选用的是哪款芯片,检查一下输出GPIO口是否正确配置。
我是在epwm的中断里面读取EPwm1Regs.CMPA.half.CMPA和EPwm1Regs.TBCTR的值,然后输出DA用示波器观察,代码如下(中断里面):
comp=EPwm1Regs.CMPA.half.CMPA;
counter11=EPwm1Regs.TBCTR;
DA0= comp/15000;
if(DA0>=0.9999)
DA0=0.9999;
if(DA0<=-0.9999)
DA0=-0.9999;
*DA_ADD0 = DA0 * 2048+2048;
DA1= counter11/15000;
if(DA1>=0.9999)
DA1=0.9999;
if(DA1<=-0.9999)
DA1=-0.9999;
*DA_ADD1 = DA1 * 2048+2048;
但是示波器显示的都是一条直线,教问各位前辈是怎么回事呢
mangui zhang:
DA是连接到并行的GPIO上的吗
应该是你的DA配置有问题 比如clk输出 等