Professional Documents
Culture Documents
DIGITAL
CONVERTOR
PIC18f452
INTRO
8 ADCs (ANO-AN7) in PIC18f452 with 10-bit resolution
The A/D module has four registers. These registers are:
Used to
8- bit A/D Control Register 0 (ADCON0) configure
settings of ADC
8- bit A/D Control Register 1 (ADCON1)
8- bit A/D Result High Register (ADRESH) Hold binary
result of
8- bit A/D Result Low Register (ADRESL)
converted
analog signal
3. Step Size: smallest step after which ADC provide us a new binary number
Step Size = (Vref+ - Vref-)/(2^n)
e.g for Vref=5v, n=10 step= 5/1024 = 4.88mv
bit 7-6 ADCS1:ADCS0: A/D Conversion Clock Select bits (ADCON0 bits in bold , ADCS2 bit
is in ADCON1 reg)
<ADCS2:ADCS1:ADCS0> Clock Conversion
000 FOSC/2
001 FOSC/8
010 FOSC/32
011 FRC (clock derived from the internal A/D RC oscillator)
100 FOSC/4
101 FOSC/16
110 FOSC/64
111 FRC (clock derived from the internal A/D RC oscillator)
A = Analog input
D = Digital I/O
C/R =
# of analog input
channels / # of ADC
voltage references
ADC CODING??