The 16F628 has Analog COMPARATORS not A-D Convertors.
You can use those Comparators for Voltage Measurement, and there are a number of ways to do that, but none are really for the inexperienced and the very easy solutions give poor results.
For better results, try the Sigma-Delta method.... here is a paper describing it...
http://www.numerix-dsp.com/appsnotes...igma-delta.pdf
...if you can understand it, then you can move forward. If you can't then you have a choice...
(a) Use the Comparators with the Internal Voltage Reference which will give you roughly 16 steps over a very small voltage range - always assuming your input signal is reasonably unchanging over a rather long sampling period (say about 180mS).
(b) Add an external programmable voltage reference your PIC can control.
(c) Use an external A-D Convertor as a 'front-end' input to your PIC.
(d) Chose a PIC which has internal AD convertors - the PIC16F628 doesn't.
Bookmarks