Microchip Technology ARD00330 データシート

ページ / 480
 2010 Microchip Technology Inc.
Preliminary
DS39979A-page 273
PIC18F87J72 FAMILY
21.0 12-BIT ANALOG-TO-DIGITAL 
CONVERTER (A/D) MODULE
The Analog-to-Digital (A/D) Converter module has
12 inputs for all PIC18F87J72 family devices. This
module allows conversion of an analog input signal to
a corresponding 12-bit digital number. 
The module has these registers:
• A/D Result High Register (ADRESH)
• A/D Result Low Register (ADRESL)
• A/D Control Register 0 (ADCON0)
• A/D Control Register 1 (ADCON1)
• A/D Control Register 2 (ADCON2)
The ADCON0 register, shown in Register 21-1,
controls the operation of the A/D module. The
ADCON1 register, shown in Register 21-2, configures
the functions of the port pins. The ADCON2 register,
shown in Register 21-3, configures the A/D clock
source, programmed acquisition time and justification.
  
REGISTER 21-1:
ADCON0: A/D CONTROL REGISTER 0 
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
ADCAL
CHS3
CHS2
CHS1
CHS0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
ADCAL: A/D Calibration bit
1 = Calibration is performed on the next A/D conversion 
0 = Normal A/D Converter operation (no calibration is performed)
bit 6
Unimplemented: Read as ‘0’
bit 5-2
CHS<3:0>: Analog Channel Select bits
0000 = Channel 00 (AN0)
0001 = Channel 01 (AN1)
0010 = Channel 02 (AN2)
0011 = Channel 03 (AN3)
0100 = Channel 04 (AN4)
0101 = Channel 05 (AN5)
0110 = Channel 06 (AN6)
0111 = Channel 07 (AN7)
1000 = Channel 08 (AN8)
1001 = Channel 09 (AN9)
1010 = Channel 10 (AN10)
1011 = Channel 11 (AN11)
11xx = Unused
bit 1
GO/DONE: A/D Conversion Status bit
When ADON = 1: 
1 = A/D conversion is in progress
0 = A/D is Idle 
bit 0
ADON: A/D On bit
1 = A/D Converter module is enabled 
0 = A/D Converter module is disabled