SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 72
Version 2.0
7.5 PORT 4 ADC SHARE PIN
The Port 4 is shared with ADC input function and no Schmitt trigger structure. Only one pin of port 4 can be configured
as ADC input in the same time by ADM register. The other pins of port 4 are digital I/O pins. Connect an analog signal
to COMS digital input pin, especially the analog signal level is about 1/2 VDD will cause extra current leakage. In the
power down mode, the above leakage current will be a big problem. Unfortunately, if users connect more than one
analog input signal to port 4 will encounter above current leakage situation. P4CON is Port4 Configuration register.
Write
“1” into P4CON.n will configure related port 4 pin as pure analog input pin to avoid current leakage.
0AEH
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P4CON
P4CON7
P4CON6
P4CON5
P4CON4
P4CON3
P4CON2
P4CON1
P4CON0
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
After reset
0
0
0
0
0
0
0
0
Bit[4:0]
P4CON[7:0]:
P4.n configuration control bits.
0 = P4.n can be an analog input (ADC input) or digital I/O pins.
1 = P4.n is pure analog input, can
‟t be a digital I/O pin.
Note: When Port 4.n is general I/O port not ADC channel, P4CON.n
must set to “0” or the Port 4.n digital
I/O signal would be isolated.
Port 4 ADC analog input is controlled by GCHS and CHSn bits of ADM register. If GCHS = 0, P4.n is general purpose
bi-direction I/O port. If GCHS = 1, P4.n pointed by CHSn is ADC analog signal input pin.
0B1H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
ADM
ADENB
ADS
EOC
GCHS
AVREFH
CHS2
CHS1
CHS0
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
After reset
0
0
0
0
0
0
0
0
Bit 4
GCHS:
Global channel select bit.
0 = Disable AIN channel.
1 = Enable AIN channel.
Bit 3
AVREFH:
ADC external high reference voltage input pin control bit.
0 = ADC high reference voltage is from internal Vdd. P4.0 is GPIO or AIN0 pin.
1 = Enable ADC external high reference voltage input pin from P4.0.
Bit[2:0]
CHS[2:0]:
ADC input channels select bit.
000 = AIN0, 001 = AIN1, 010 = AIN2, 011 = AIN3, 100 = AIN4, 101 = AIN5, 110 = AIN6, 111 = AIN7.
Note: For P4.n general purpose I/O function, users should make sure of P4.n
’s ADC channel is disabled,
or P4.n is automatically set as ADC analog input when GCHS = 1 and CHS[2:0] point to P4.n.