PINSEL0 = 0x03050005; //Ain5 PCONP |= (1 << 12); //pd=1,
ADCR = 0x00200300 | (0x20); /* Init ADC (Pclk = 12MHz) and select channel ,11 clock 10bit*/ ADCR |= 0x01000000; /* Start A/D Conversion*/ do { ADValue= ADDR5; /*Read A/D Data Register*/ } while ((ADValue & 0x80000000) == 0); /* Wait for end of A/D Conversion(bit31 :done )*/ return (ADValue>> 6) & 0x03FF; /* bit[15:6] is 10 bit AD value */
返回的数据总是3FF |