i am working a voltmeter project.it is based on 16f676. but don't understand ADC calculations in the voltmeter project . i see also Electronic Circuits it is not working properly. and c lang. also
The A/D input to a Pic is usually ratiometric with respect to the Vdd pin, meaning if it is a 10 bit A/D, it will read out 1023 (2^10-1) when the analog input is the same as Vdd. That means you have to know what Vdd actually is; 5V is not good enough. You have to know if it is 4.87V or 5.04V.
Does that particular pic not have an internal voltage reference? I'm used to AVR's which although they can use VCC as a voltage ref also generally have an internal bandgap voltage source of around 2.54 volts, so long as the VCC voltage is above the internal circuitry's threshold for regulation. (not sure what that is off the top of my head) the ADC results will be unaffected.
The A/D input to a Pic is usually ratiometric with respect to the Vdd pin, meaning if it is a 10 bit A/D, it will read out 1023 (2^10-1) when the analog input is the same as Vdd. That means you have to know what Vdd actually is; 5V is not good enough. You have to know if it is 4.87V or 5.04V.