PIC16C923-04I/CL Microchip Technology, PIC16C923-04I/CL Datasheet - Page 80

no-image

PIC16C923-04I/CL

Manufacturer Part Number
PIC16C923-04I/CL
Description
8-Bit CMOS Microcontroller with LCD Driver
Manufacturer
Microchip Technology
Datasheet
version is started. The analog input channels must
have their corresponding TRIS bits selected as an
input. To determine acquisition time, see Section 12.1.
After this acquisition time has elapsed the A/D conver-
sion can be started. The following steps should be fol-
lowed for doing an A/D conversion:
1.
PIC16C9XX
FIGURE 12-2: ADCON1 REGISTER (ADDRESS 9Fh)
The ADRES register contains the result of the A/D con-
version. When the A/D conversion is complete, the
result is loaded into the ADRES register, the GO/DONE
bit (ADCON0<2>) is cleared, and A/D interrupt flag bit
ADIF is set. The block diagram of the A/D module is
shown in Figure 12-3.
After the A/D module has been configured as desired,
the selected channel must be acquired before the con-
2.
DS30444E - page 80
bit7
bit 7-3: Unimplemented: Read as '0'
bit 2-0: PCFG2:PCFG0: A/D Port Configuration Control bits
Configure the A/D module:
• Configure analog pins / voltage reference /
• Select A/D input channel (ADCON0)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
Configure A/D interrupt (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set GIE bit
U-0
and digital I/O (ADCON1)
U-0
A = Analog input
D = Digital I/O
U-0
PCFG2:PCFG0
000
001
010
011
100
111
U-0
U-0
A
A
A
A
A
D
RA0
PCFG2
R/W-0
A
A
A
A
A
D
RA1
3.
4.
5.
6.
7.
A
A
A
A
D
D
RA2
PCFG1
Wait the required acquisition time.
Start conversion:
• Set GO/DONE bit (ADCON0)
Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE bit to be cleared
OR
• Waiting for the A/D interrupt
Read A/D Result register (ADRES), clear bit
ADIF if required.
For next conversion, go to step 1 or step 2 as
required. The A/D conversion time per bit is
defined as T
required before next acquisition starts.
R/W-0
A
A
A
A
D
D
RA5
PCFG0
R/W-0
AD
A
V
A
V
A
D
bit0
. A minimum wait of 2T
RA3
REF
REF
1997 Microchip Technology Inc.
R = Readable bit
W = Writable bit
U = Unimplemented
- n = Value at POR reset
A
RA3
A
RA3
A
V
VDD
VDD
VDD
REF
bit, read as ‘0’
AD
is

Related parts for PIC16C923-04I/CL