EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_SINGLE);
配置成以上单端模式是可以 ,但是配置成以下差分模式,读寄存器的值就不准了,怀疑是不是与其文档中说的16位模式共模输入电压范围有关??
EALLOW;
AdcaRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCA, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);
AdcbRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCB, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);
AdccRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCC, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);
AdcdRegs.ADCCTL2.bit.PRESCALE = AD_ADCCLKPS; //set ADCCLK divider to /4
AdcSetMode(ADC_ADCD, ADC_RESOLUTION_16BIT, ADC_SIGNALMODE_DIFFERENTIAL);