[Menu]>[Guide to use the PIC]>[877 Hardware]>[SFR]


SFR explanation for PIC16F877(4)
ADCON0 ( A/D converter control register 0 ) 1Fh

The A/D converter condition is controlled with this register.

The value in the parenthesis is in the condition immediately after the turning on.

ADCS1,ADCS0 : A/D conversion clock select bits
ADCS1ADCS0Clock
00Fosc/2
01Fosc/8
10Fosc/32
11RC
In case of RC, the clock is driven from an RC oscillator.

CHS2,CHS1,CHS0 : Analog channel select bits
CHS2CHS1CHS0Input channel
000Channel 0 ( RA0/AN0 )
001Channel 1 ( RA1/AN1 )
010Channel 2 ( RA2/AN2 )
011Channel 3 ( RA3/AN3 )
100Channel 4 ( RA5/AN4 )
101Channel 5 ( RE0/AN5 )
110Channel 6 ( RE1/AN6 )
111Channel 7 ( RE2/AN7 )

GO/DONE : A/D conversion status bit
1:A/D conversion in progress
0:A/D conversion not in progress ( This bit is automatically cleared by hardware )

ADON : A/D ON bit
1:A/D conversion module is operating
0:A/D conversion module is shutoff and operating current



ADCON1 ( A/D converter control register 1 ) 9Fh

The A/D converter condition is controlled with this register.

The value in the parenthesis is in the condition immediately after the turning on.

ADFM : A/D result format select
1:Right justified. 6 most significant bits of ADRESH are read as 0.
0:Left justified. 6 least significant bits of ADRESL are read as 0.

PCFG3,PCFG2,PCFG1,PCFG0 : A/D port configuration control bits
PCFG
3210
Port Remarks
AN7AN6AN5AN4AN3AN2AN1AN0
0000AAAAAAAA
0001AAAAVREF+AAA
0010DDDAAAAA
0011DDDAVREF+AAA
0100DDDDADAA
0101DDDDVREF+DAA
0110DDDDDDDDSame as 0111
0111DDDDDDDDSame as 0110
1000AAAAVREF+VREF-AA
1001DDAAAAAA
1010DDAAVREF+AAA
1011DDAAVREF+VREF-AA
1100DDDAVREF+VREF-AA
1101DDDDVREF+VREF-AA
1110DDDDDDDA
1111DDDDVREF+VREF-DA
A: Analog port
D: Digital port
VREF+: High reference voltage
VREF-: Low reference voltage



GPR ( General Purpose Register ) 20h-7Fh/A0h-FFh/110h-17Fh/190h-1FFh

The general purpose register has the area which is common to all the banks and an area of each bank. The area of each bank can not do reading and writing when it doesn't change a bank. The composition of the area is different from PIC16F873.
KindCapacityAddress
Common of all the banks16 bytes 70h-7Fh
( F0h-FFh )
( 170h-17Fh )
( 1F0h-1FFh )
Each bankBank080 bytes20h-6Fh
Bank180 bytesA0h-EFh
Bank296 bytes110h-16Fh
Bank396 bytes190h-1EFh