Datasheet

PIC16F785/HV785
DS41249E-page 88 © 2008 Microchip Technology Inc.
12.3 A/D Operation During Sleep
The A/D Converter module can operate during Sleep.
This requires the A/D clock source to be set to the F
RC
option. When the RC clock source is selected, the A/D
waits one instruction before starting the conversion.
This allows the SLEEP instruction to be executed, thus
eliminating much of the switching noise from the con-
version. When the conversion is complete, the GO/
DONE
bit is cleared and the result is loaded into the
ADRESH:ADRESL registers. If the A/D interrupt is
enabled (ADIE and PEIE bits set), the device awakens
from Sleep. If the GIE bit of the INTCON Register is set,
the program counter is set to the interrupt vector
(0004h). If GIE is clear, the next instruction is executed.
If the A/D interrupt is not enabled, the A/D module is
turned off, although the ADON bit remains set.
When the A/D clock source is something other than
RC, a SLEEP instruction causes the present conversion
to be aborted and the A/D module is turned off. The
ADON bit remains set.
FIGURE 12-5: A/D TRANSFER FUNCTION
3FFh
3FEh
A/D Output Code
3FDh
3FCh
004h
003h
002h
001h
000h
Full-Scale
3FBh
1 LSb ideal
0V
Zero-Scale
Transition
V
REF
Transition
1 LSb ideal
Full-Scale Range
Analog Input Voltage