Hi, I have an ADC pin connected to ground by a 4.7Mohm resistor. When I read the value by adc I get 32 that means 32*(2.5V/255)=310mV if the reference voltage is 2.5Volt and the resolution is 8 bit.
I wander why the value is so big, it should by almost zero.
How can reduce the sampled value.
0...1uA x 4.7M = 0...4.7V. In your case Iin must be about 66nA. From the data sheet it could be a lot more and you will probably find that if you heat the device the error will increase a lot.
To ensure accuracy you need to have a low impedance input source; 4.7M is much too large for any accuracy to be ensured. Eg. Add a voltage follower between the input source and the ADC.