我用2812板子自带的pwm1通道(即GPIOA0)产生pwm波,同时用cap1((即GPIOA8)捕捉此波形,但是执行后,评为pwm输出正常,但是捕捉通道一的寄存器CAP1FIFO和CAP1FBOT中值都为零.同时又试了其他通道,也是这样.奇怪的是,无论 cap引脚悬空时,还是连接上pwm波,捕捉通道的的中断标志却置位了,请问各位高手是什么原因?谢谢!
附上一段 事件管理器初始化的程序 请大家帮着看看 void InitEv(void) { EALLOW; GpioMuxRegs.GPAMUX.all=0xffff; EDIS; EvaRegs.ACTR.all = 0x0006; / //EvaRegs.DBTCONA.all = 0x0530; EvaRegs.COMCONA.all = 0xA600; EvaRegs.T1CNT = 0; EvaRegs.T1PR = 937; EvaRegs.CMPR1 = 80; EvaRegs.T1CON.all = 0x174E; EvaRegs.CAPCON.all=0; EvaRegs.CAPCON.bit.CAPQEPN=1; EvaRegs.CAPCON.bit.CAP3EN=1; EvaRegs.CAPCON.bit.CAP3TSEL=1; EvaRegs.CAPCON.bit.CAP12TSEL=1; EvaRegs.CAPCON.bit.CAP1EDGE=11; EvaRegs.CAPCON.bit.CAP2EDGE=10; EvaRegs.CAPCON.bit.CAP3EDGE=11; EvaRegs.CAPFIFO.all=0x1500; }
|