Dear team:
My customer want to configure the unused AIO (AIO224) as an input GPIO for eCAP, After performing the following configuration, the program can not enter the eCAP interrupt after running.
The ECAP initialization code is as follows:
InputXbarRegs.INPUT1SELECT = 224; //使用INPUT1--AIO224引脚 GpioCtrlRegs.GPHAMSEL.bit.GPIO224 = 1;//The analog function of the pin is disabled GpioCtrlRegs.GPHQSEL1.bit.GPIO224 = 1; //GPIO配置为同步模式 GpioCtrlRegs.GPHCTRL.bit.QUALPRD0=150; EALLOW; ECap1Regs.ECCTL0.bit.INPUTSEL = 0; //ECap1捕获引脚对应到INTPUT0 ECap1Regs.ECEINT.all = 0x0000; // Disable all capture interrupts ECap1Regs.ECCLR.all = 0xFFFF; // Clear all CAP interrupt flags ECap1Regs.ECCTL1.bit.CAPLDEN = 0; // Disable CAP1-CAP4 register loads ECap1Regs.ECCTL2.bit.TSCTRSTOP = 0; // Make sure the counter is stopped // Configure peripheral registers ECap1Regs.ECCTL2.bit.CAP_APWM = 0; // CAP mode ECap1Regs.ECCTL2.bit.CONT_ONESHT = 0; // Continuous mode ECap1Regs.ECCTL2.bit.STOP_WRAP = 1; // Stop at 2 events ECap1Regs.ECCTL1.bit.PRESCALE = 0; // Divide by 1 分频 ECap1Regs.ECCTL1.bit.CAP1POL = 1; // falling edge ECap1Regs.ECCTL1.bit.CAP2POL = 1; // falling edge ECap1Regs.ECCTL1.bit.CTRRST1 = 1; // Difference operation ECap1Regs.ECCTL1.bit.CTRRST2 = 0; // Difference operation ECap1Regs.ECCTL2.bit.SYNCI_EN = 0; // Enable sync in ECap1Regs.ECCTL2.bit.SYNCO_SEL = 3; // Disable sync out signal ECap1Regs.ECCTL1.bit.CAPLDEN = 1; // Enable capture units ECap1Regs.ECCTL2.bit.TSCTRSTOP = 1; // Start Counter 启动 // ECap1Regs.ECEINT.bit.CEVT2 = 1; // 2 events = interrupt ECap1Regs.ECEINT.bit.CEVT1 = 1; // 1 events = interrupt EDIS;
Is there a problem with the configuration?
Best regards