16
EasyPIC6 Development System
MikroElektronika
page
11.0. A/D Converter
An A/D converter is used for the purpose of converting an analog signal into the appropriate digital value. A/D converter is linear, which means
that the converted number is linearly dependent on the input voltage value.
The A/D converter built into the microcontroller provided with the EasyPIC6 development system converts an analog voltage value into a
10-bit number. Voltages varying from 0V to 5V DC may be supplied through the A/D test inputs. Jumper J15 is used for selecting some of the
IROORZLQJSLQV5$5$5$5$RU5$IRU$'FRQYHUVLRQ7KH5UHVLVWRUKDVDSURWHFWLYHIXQFWLRQDVLWLVXVHGIRUOLPLWLQJFXUUHQWÀRZ
through the potentiometer or the microcontroller pin. The value of the input analog voltage can be changed linearly using potentiometer P1.
Figure 11-1
: ADC (default
jumper positions)
Figure 11-2
: The RA0 pin
used as A/D conversion input
VCC-MCU
VCC-MCU
VCC-MCU
J15
R63
220R
P1
10K
P1
10K
X1
8MHz
C6
22pF
C7
22pF
PICxxxx
OSC2
RC0
RC1
RC2
RC3
RD0
RD1
OSC1
GND
GND
RD7
RD6
RD5
RD4
RC7
RC6
RC5
RC4
RD3
RD2
VCC
MCLR
RA0
RA1
RA2
RA3
RA4
RA5
RE0
RE1
RE2
VCC
RB0
RB1
RB2
RB3
RB4
RB5
RB6
RB7
DIP40
Top view
Figure 11-4
: Microcontroller in DIP40 package and A/D converter test
inputs connectiion
Figure 11-5
: Microcontroller in DIP28 package and A/D converter test
inputs connection
VCC-MCU
VCC-MCU
J15
R63
220R
P1
10K
P1
10K
X1
8MHz
C6
22pF
C7
22pF
Top view
VCC-MCU
VCC-MCU
J15
R63
220R
P1
10K
P1
10K
X1
8MHz
C6
22pF
C7
22pF
Top view
DIP18A
RB2
RA1
OSC1
RA4
OSC2
MCLR
VCC
GND
RB7
RA2
RB6
RA3
RB5
RB0
RB4
RB1
RB3
RA0
Figure 11-3
: Microcontroller in DIP18A package and A/D converter test
inputs connection
127(
In order to enable the microcontroller to accurately perform A/D conversion, it is necessary to turn off LED diodes and
pull-up/pull-down resistors on port pins used by the A/D converter.
RA0 is A/D input
RA0 is A/D input
RA0 is A/D input