部分程序贴出来了,ADC中断程序里面我点亮了LED灯的,但程序跑起来之后LED灯没点亮。也就是没有进入中断。我用的是ADC INT1.6,不过那个SEQ中断 InitSysCtrl(); DINT; IER=0x0000; IFR=0x0000; InitPieCtrl(); InitPieVectTable(); EnableInterrupts(); IER|=M_INT1; PieCtrlRegs.PIEIER1.bit.INTx6=1; InitAdc(); EALLOW; PieVectTable.ADCINT=&adc; EDIS; EINT; ERTM;
AdcRegs.ADCTRL1.bit.ACQ_PS = 1; AdcRegs.ADCTRL1.bit.CPS = 0; AdcRegs.ADCTRL3.bit.ADCCLKPS = 0; AdcRegs.ADCTRL1.bit.SUSMOD=0x3; AdcRegs.ADCTRL1.bit.SEQ_CASC = 1; AdcRegs.ADCCHSELSEQ1.bit.CONV00 = 0x2; AdcRegs.ADCCHSELSEQ1.bit.CONV01 = 0x2; AdcRegs.ADCCHSELSEQ1.bit.CONV02 = 0x2; AdcRegs.ADCTRL1.bit.CONT_RUN = 0; AdcRegs.ADCTRL3.bit.SMODE_SEL=0;//顺序采样// AdcRegs.ADCMAXCONV.bit.MAX_CONV1=0x2;
AdcRegs.ADCTRL2.bit.SOC_SEQ1=1; While(1);
|