unsigned int ADC_CollectionWait(unsigned char Channel)
{
UINT16 ADC_Value = 0;
ADCCON0 &= 0xF0;
if (Channel == 0x05)
{
Enable_ADC_AIN5;
}
else if (Channel == 0x06)
{
Enable_ADC_AIN6;
}
clr_ADCF;
set_ADCS; // ADC start trig signal
while(ADCF == 0);
ADC_Value = (ADCRH << 4) + ADCRL;
ADC_Value = ADC_Value / 4;
return ADC_Value;
}
请问问题出在哪里啊?当通道六的AD值比较小(小于90)的时候,就会出现AD值不准确(有时AD值会变为65535),求大神来帮看下 |