8* Channel Analog-to-Digital Converter using a Microchip PIC


Build a simple 8 Channel ADC with the PIC16F767 from Microchip.

* A design note: Since the ADC has a Chip Select pin, you can add as many A/D channels as you want.

The schematic in PDF format can be downloaded here - ADCWithPIC16F767.pdf

The Microchip PIC16F767 program was written in BASIC using the Proton Development Suite from Crownhill Associates.
Of course you can use any other development software of your choice that are available for PIC microcontrollers.
The entire program code in PDF format can be downloaded here - ProtonBasicProgram.pdf

Operation and Programming:

As soon as the PIC is powered ON, starting with CH0, it continually loops through all channels and converts what ever voltage (0 to +5Vdc) present at the channel.
The ADRESH (A/D Result Register High Byte) and ADRESL (A/D Result Register Low Byte) results are saved in an array table.
The following steps are to be taken to read the analog voltage on the A/D channel:
Step 1 - Select which channel you want to read by setting the channel select lines - CHSEL0, CHSEL1 and CHSEL2.
Step 2 - Select if you want to read the Most Significant Byte (MSB) first or the Least Significant Byte (LSB) of the selected channel.
Step 3 - Strobe or pulse the CS_NOT pin (active LOW). This signals the ADC that you are ready to read the MSB or the LSB of the selected channel.
Step 4 - Bring or clear the OE_NOT pin (active LOW) so that the PIC outputs the MSB or the LSB value at the Data Byte Output Port.
Step 5 - Wait or delay for 50 microseconds.
Step 6 - Get the MSB/LSB value.
Step 7 - Set the OE_NOT pin HIGH.
Step 8 - Repeat steps 2 to 6 for the the next significant byte.

Testing the PIC ADC

NOTE: I know the Arduino UNO already has analog A/D pins A0 to A5, but I wrote a sketch to test it.
The entire program code in PDF format can be downloaded here - UNO_SketchADCWithPIC16F767.pdf

The following are screen captures of CH0 to CH7 using the UNO: