User manual

Table Of Contents
Analog-to-Digital Converter Peripheral Labs
© 2009 Microchip Technology Inc. DS41369A-page 77
FIGURE 5-1: SCHEMATIC FOR ADC LAB 1
The voltage reference is software selectable as either V
DD or an external voltage
applied to the external reference pin 18 (V
REF). To minimize circuit complexity, this
application makes use of V
DD
as the reference.
The software flowchart for this lab is shown in Figure 5-2.
FIGURE 5-2: MAIN() SOFTWARE CONTROL LOOP FLOWCHART FOR
COMPARATOR LAB 1
1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
J9J8
R3
470
LED3
V
DD
R5
100K
V
SS
V
SS
RB4/AN10
U2
RC0
RC1
RC2
RC3
R2
470
LED2
V
SS
R1
470
LED1
V
SS
R4
470
LED4
V
SS
main()
Initialize()
Loop Forever
Get_Inputs()
Decide()
Do_Outputs()
Global variables initialized:
8-bit variable LED_output will be used to
light the three LEDs connected to PORTC