In this tutorial i will be discussing the ADC module of the PIC Microcontroller. You can also check my previous post on interfacing the 7 - Segment Display with PIC microcontroller .
The PIC microcontroller has an in-built ADC Module. Analog to Digital Converters are widely used devices for Data acquisition. The physical world is Analog (i.e. Continuous) but Digital Computers use Binary values (i.e. Discrete ) . Physical quantities such as Temperature, Pressure , Humidity , Velocity etc. are converted to electrical signals (voltage and current) using a device called a transducer. Transducers are also referred to as Sensors. Sensors senses Analog quantities and there is need for an Analogue to Digital converter so that a Microcontroller can process the information gotten from these sensors.
Conversion Time
Conversion time is the time it takes the ADC to convert the Analog input into a Digital value , This time is determined by the clock source connected to the ADC, method used for data conversion and also the technology used in the fabrication of the ADC chip.
Several PIC MCU have different ADC inputs, PIC MCU with twenty-eight (28) pins has five (5) ADC inputs while PIC MCUs with forty /forty-four (40/44) pins have eight (8) ADC inputs. The ADC module of a PIC MCU is a 10-bit ADC i.e. it converts the Analog signal into a corresponding 10-bit digital value. The positive and negative reference voltage (+Vref and -Vref) of PIC ADC is software selectable, which can be VDD, VSS, voltage at RA2 or RA3.
To learn more about the ADC module of the PIC MCU you can check out the data sheet of the popular PIC16F877A here
MikroC PRO for PIC Compiler has a set of built-in functions that makes it easy to interface tranducers with the PIC MCU via the ADC module.
Check out these functions with descriptions here.
Circuit Diagram:
0 Comments