The good old PIC16F84A does not have an analogue to digital converter (ADC) on board. A good solution to this problem is offered by the TLC549 serial ADC made by Texas Instruments. The TLC549 uses only 3 of the I/O pins of the controller, is very compact and is also readily available.
The TLC549 control lines CS and l/O-Clock are controlled from the PIC. The result of the conversion is available via the serial output of the ADC (Data Out), one bit at a time, and is stored into a byte of RAM in
the PIC. You can find a detailed description of how this works in the Texas Instruments data sheet: http://focus.ti.com/lit/ds/symlink/tlc549.pdf. The program shows how the 8 bits in the RESULT byte are fetched in (lines 10 to 25).



