You are on page 1of 1

PIC16877 ADC Sample

This sample shows the functioning of the a single ADC channel of the PIC16877
microcontroller.

A potential divider is used to splot a 10V reference with the voltage being applied
to the ADC channel 0. The PIC continually samples the voltage and displays the
value on the 7-segment displays. Values are displayed are in hexadecimal and,
as the PIC's ADC is 10-bit, range from 0x0000 to 0x03FF (1023 decimal).

To experiment with the design, press the "Play" button to run the simulation
and then click on the up/down controls next to the potentiometer to adjust
its value.

+5V VDD

U1 U2
+88.8 13 33 3 2 D0
RV1 Volts OSC1/CLKIN RB0/INT D0 Q0
14 34 4 5 D1
OSC2/CLKOUT RB1 D1 Q1
1 35 7 6 D2
MCLR/Vpp/THV RB2 D2 Q2
36 8 9 D3
RB3/PGM D3 Q3
+88.8 2 37 13 12 D4
50%

RA0/AN0 RB4 D4 Q4
3 38 14 15 D5
mA RA1/AN1 RB5 D5 Q5
4 39 17 16 D6
RA2/AN2/VREF- RB6/PGC D6 Q6
5 40 18 19 D7
RA3/AN3/VREF+ RB7/PGD D7 Q7
1k 6
+88.8 RA4/T0CKI

D[0..15]
7 15 1
Volts RA5/AN4/SS RC0/T1OSO/T1CKI OE
16 11
RC1/T1OSI/CCP2 LE
8 17 D[0..15]
RE0/AN5/RD RC2/CCP1
9 18 74LS373
RE1/AN6/WR RC3/SCK/SCL
10 23
RE2/AN7/CS RC4/SDI/SDA U3
24
RC5/SDO
25 3 2 D8
RC6/TX/CK D0 Q0
26 4 5 D9
RC7/RX/DT D1 Q1
7 6 D10
VSS D2 Q2
19 8 9 D11
RD0/PSP0 D3 Q3
20 13 12 D12
RD1/PSP1 D4 Q4
21 14 15 D13
RD2/PSP2 D5 Q5
22 17 16 D14
RD3/PSP3 D6 Q6
27 18 19 D15
RD4/PSP4 D7 Q7
28
RD5/PSP5
29 1
RD6/PSP6 OE
30 11
RD7/PSP7 LE
PIC16877 74LS373

PIC16877 ADC Sample


Labcenter Electronics, 53-55 Main Street, Grassington, North Yorkshire, BD23 5AA
Fax: +44 (0)1756 752857 Tel: +44 (0)1756 753440
E l e c t r o n i c s
Email: info@labcenter.co.uk WWW: http://www.labcenter.co.uk/

You might also like