Datasheet
PIC18F1230/1330
2009 Microchip Technology Inc. DS39758D-page 169
16.0 10-BIT ANALOG-TO-DIGITAL
CONVERTER (A/D) MODULE
The Analog-to-Digital (A/D) Converter module has
4 inputs for the 18/20/28-pin devices. This module
allows conversion of an analog input signal to a
corresponding 10-bit digital number in PIC18F1230/
1330 devices.
The module has five registers:
• A/D Result Register High Byte (ADRESH)
• A/D Result Register Low Byte (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 16-1,
controls the operation of the A/D module. The
ADCON1 register, shown in Register 16-2, configures
the functions of the port pins. The ADCON2 register,
shown in Register 16-3, configures the A/D clock
source, programmed acquisition time and justification.
REGISTER 16-1: ADCON0: A/D CONTROL REGISTER 0
R/W-0 U-0 U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0
SEVTEN
— — — 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 SEVTEN: Special Event Trigger Enable bit
1 = Special Event Trigger from Power Control PWM module is enabled
0 = Special Event Trigger from Power Control PWM module is disabled (default)
bit 6-4 Unimplemented: Read as ‘0’
bit 3-2 CHS1:CHS0: Analog Channel Select bits
00 = Channel 0 (AN0)
01 = Channel 1 (AN1)
10 = Channel 2 (AN2)
11 = Channel 3 (AN3)
bit 1 GO/DONE
: A/D Conversion Status bit
When ADON =
1:
1 = A/D conversion in progress
0 = A/D Idle
bit 0 ADON: A/D On bit
1 = A/D Converter module is enabled
0 = A/D Converter module is disabled