SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
13.4.3 ADC PIN CONFIGURATION
ADC input channels are shared with Port4. ADC channel selection is through ADCHS[2:0] bit. ADCHS[2:0] value points
to the ADC input channel directly. ADCHS[2:0]=000 selects AIN0. ADCHS[2:0]=001 selects AIN1……Only one pin of
port 4 can be configured as ADC input in the same time. The pins of Port4 configured as ADC input channel must be
set input mode, disable internal pull-up and enable P4CON first by program. After selecting ADC input channel through
ADCHS[2:0], set GCHS bit as “1” to enable ADC channel function.
The GPIO mode of ADC input channels must be set as input mode.
The internal pull-up resistor of ADC input channels must be disabled.
P4CON bits of ADC input channel must be set.
The P4.0/AIN0 can be ADC external high reference voltage input pin when AVREFH=1. In the condition, P4.0 GPIO
mode must be set as input mode and disable internal pull-up resistor.
The GPIO mode of ADC external high reference voltage input pin must be set as input mode.
The internal pull-up resistor of ADC external high reference voltage input pin must be disabled.
ADC input pins are shared with 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 [7:0] 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
After reset
W
0
W
0
W
0
W
0
W
0
W
0
W
0
W
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.
SONiX TECHNOLOGY CO., LTD
Page 112
Version 2.0