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.
void ADC_Init(void)
{
int i;
DINT;
EALLOW;
AdcRegs.ADCCTL1.bit.ADCBGPWD=1;
AdcRegs.ADCCTL1.bit.ADCREFPWD=1;
for(i=0;i<20000;i++);
AdcRegs.ADCCTL1.bit.ADCPWDN=1;
for(i=0;i<2000;i++);
AdcRegs.ADCCTL1.bit.ADCENABLE=ADC_ENABLE;
AdcRegs.ADCCTL1.bit.ADCREFSEL=0; //Internal Bandgap used for reference generation
AdcRegs.ADCCTL1.bit.TEMPCONV=1; //Temperature sensor is internally connected to the ADC for sampling
//AdcRegs.ADCCTL1.bit.ADCENABLE=ADC_ENABLE;
AdcRegs.ADCSOC0CTL.bit.CHSEL=CHSEL_ADCINA5;
AdcRegs.ADCSOC0CTL.bit.ACQPS=6; //set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
AdcRegs.ADCSOC0CTL.bit.TRIGSEL=ADCTRIG_EPWM1A;
AdcRegs.INTSEL1N2.bit.INT1SEL = 0;
AdcRegs.INTSEL1N2.bit.INT1E = 1; //Enabled ADCINT1
AdcRegs.ADCSOC1CTL.bit.CHSEL=CHSEL_ADCINA1;
AdcRegs.ADCSOC1CTL.bit.ACQPS=14; //set SOC1 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)
AdcRegs.ADCSOC1CTL.bit.TRIGSEL=ADCTRIG_SOFT;
AdcRegs.INTSEL1N2.bit.INT2SEL = 1;
AdcRegs.INTSEL1N2.bit.INT2E = 1; //Enabled ADCINT2
AdcRegs.ADCSOC2CTL.bit.CHSEL = CHSEL_ADCINA0;
AdcRegs.ADCSOC2CTL.bit.ACQPS = 14;
AdcRegs.ADCSOC2CTL.bit.TRIGSEL = ADCTRIG_SOFT;
AdcRegs.INTSEL3N4.bit.INT3SEL = 2;
AdcRegs.INTSEL3N4.bit.INT3E = 1; //Enabled ADCINT2
AdcRegs.ADCCTL1.bit.INTPULSEPOS = 1; //ADCINT1 trips after AdcResults latch
SysCtrlRegs.PCLKCR0.bit.ADCENCLK=1;
EDIS;
}
我在对以上寄存器进行配置时,为什么在data memory中相应寄存器值不改变,求解是何原因?
补充说明:EALLOW已写过;总中断已经屏蔽;