Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
Section 21. 8-bit A/D Converter

Section 21. 8-bit A/D Converter

Ratings: (0)|Views: 5|Likes:
Published by Guillermo Hernandez

More info:

Published by: Guillermo Hernandez on Jul 26, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/14/2013

pdf

text

original

 
©
1997 Microchip Technology Inc. DS31021A page 21-1
 8  b i   t   /   C  onv e t   o
21
M
Section 21. 8-bit A/D Converter
HIGHLIGHTS
This section of the manual contains the following major topics:21.1Introduction..................................................................................................................21-221.2Control Registers.........................................................................................................21-321.3Operation.....................................................................................................................21-521.4A/D Acquisition Requirements.....................................................................................21-621.5Selecting the A/D Conversion Clock............................................................................21-821.6Configuring Analog Port Pins.......................................................................................21-921.7A/D Conversions........................................................................................................21-1021.8A/D Operation During Sleep......................................................................................21-1221.9A/D Accuracy/Error....................................................................................................21-1321.10Effects of a RESET....................................................................................................21-1321.11Use of the CCP Trigger..............................................................................................21-1421.12Connection Considerations........................................................................................21-1421.13Transfer Function.......................................................................................................21-1421.14Initialization................................................................................................................21-1521.15Design Tips................................................................................................................21-1621.16Related Application Notes..........................................................................................21-1721.17Revision History.........................................................................................................21-18 
Note:
Please refer toAppendix C.3 or device Data Sheet to determine which devices use this module.
 
PICmicro MID-RANGE MCU FAMILY
DS31021A-page 21-2
©
1997 Microchip Technology Inc.
21.1 Introduction
The analog-to-digital (A/D) converter module has up to eight analog inputs.The A/D allows conversion of an analog input signal to a corresponding 8-bit digital number. Theoutput of the sample and hold is the input into the converter, which generates the result via suc-cessive approximation. The analog reference voltage is software selectable to either the device’spositive supply voltage (V
DD
) or the voltage level on the V
REF
pin. The A/D converter has aunique feature of being able to operate while the device is in SLEEP mode.The A/D module has three registers. These registers are:A/D Result Register (ADRES)A/D Control Register0 (ADCON0)A/D Control Register1 (ADCON1)The ADCON0 register, shown inFigure 21-1, controls the operation of the A/D module. TheADCON1 register, shown inFigure 21-2,configures the functions of the port pins. The I/O pins can be configured as analog inputs (one I/O can also be a voltage reference) or as digital I/O.The block diagram of the A/D module is shown inFigure 21-1.
Figure 21-1:8-bit A/D Block Diagram
(Input voltage)V
AIN
V
REF
(Referencevoltage)V
DD
 
(1)
PCFG2:PCFG0CHS2:CHS0
000
or
010
or
100001
or
011
or
101
AN7AN6AN5AN4AN3/V
REF
AN2AN1AN0
111110101100011010001000
8-bit A/DConverter
Note:
On some devices this is a separate pin called AV
DD
. This allows the A/D V
DD
to be connected to a precise voltage source.
 
©
1997 Microchip Technology Inc.DS31021A-page 21-3
Section 21. 8-bit A/D Converter
 8  b i   t   /   C  onv e t   e
21
21.2 Control Registers
Register 21-1:ADCON0 Register
R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0R/W-0ADCS1ADCS0CHS2CHS1CHS0GO/DONEResvADONbit 7bit 0bit 7:6
ADCS1:ADCS0
: A/D Conversion Clock Select bits
 
00
= F
OSC
 /2
01
= F
OSC
 /8
10
= F
OSC
 /32
11
= F
RC
(clock derived from the internal A/D RC oscillator)bit 5:3
CHS2:CHS0
: Analog Channel Select bits
000
= channel 0, (AN0)
001
= channel 1, (AN1)
010
= channel 2, (AN2)
011
= channel 3, (AN3)
100
= channel 4, (AN4)
101
= channel 5, (AN5)
110
= channel 6, (AN6)
111
= channel 7, (AN7)
Note:
For devices that do not implement the full 8 A/D channels, the unimplemented selec-tions are reserved. Do not select any unimplemented channels.bit 2
GO/DONE:
A/D Conversion Status bitWhen ADON = 11 = A/D conversion in progress(Setting this bit starts the A/D conversion. This bit is automatically clearedby hardware when the A/D conversion is complete)0 = A/D conversion not in progressbit 1
Reserved:
Always maintain this bit cleared.bit 0
ADON
: A/D On bit1 = A/D converter module is operating0 = A/D converter module is shutoff and consumes no operating currentLegendR = Readable bitW = Writable bitU = Unimplemented bit, read as 0- n = Value at POR reset

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->