Preliminary
SN8P1702A/SN8P1703A
8-bit micro-controller build-in 12-bit ADC
P4CON REGISTERS
ADB initial value = xxxx 0000
0AEH
P4CON
Bit 7
0
-
Bit 6
0
-
Bit 5
0
-
Bit 4
0
-
Bit 3
P4CON3
R/W
Bit 2
P4CON2
R/W
Bit 1
P4CON1
R/W
Bit 0
P4CON0
R/W
P4CON is Port4 Configuration register. This register can avoid current leakage in unselected ADC channel, which
connected to an analog input source. P4CON [3:0] sets to high will isolate related Port4 digital input path outside chip.
For example, both AIN0 (Port4.0) and AIN1 (Port4.1) are connected to analog input signal, and AIN0 be selected as
conversion channel (CHS [1:0] = 00), this mean the unselected channel P4.1 maybe in digital input mode (if P41M = 0)
In this condition will possible leak current from analog input source. Set P4CON1 = “1” can block P4.1 digital input path
to avoid the current leakage from AIN1.
For the same reason, P4CON0 must set to “1” when conversion channel is AIN1. So any Port4 pin be connected
to analog input source should be set related bit of P4CON as high to avoid unpredictable current leakage. Especially
before entering Sleep mode, remember to set related bit of P4CON as “1”.
Bit [3:0] P4CON: Port4 Configuration register.
0
1
0
1
0
1
0
1
Pass P4.3 digital path into chip.
Isolate P4.3 digital path into chip
Pass P4.2 digital path into chip.
Isolate P4.2 digital path into chip
Pass P4.1 digital path into chip.
Isolate P4.1 digital path into chip
Pass P4.0 digital path into chip.
Isolate P4.0 digital path into chip
P4CON3
P4CON2
P4CON1
P4CON0
ꢀNote 1: When Port4 is general I/O port, set related P4CON [3:0] = “0”
ꢀNote 2: When Port4 is ADC input channel, set related P4CON [3:0] = “1”
The AIN’s input voltage vs. ADB’s output data
AIN n
ADB11 ADB10 ADB9 ADB8 ADB7 ADB6 ADB5 ADB4 ADB3 ADB2 ADB1 ADB0
0/4096*AVREFH
1/4096*AVREFH
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
0
.
0
1
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4094/4096*AVREFH
4095/4096*AVREFH
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
For different applications, users maybe need more than 8-bit resolution but less than 12-bit ADC converter. To process
the ADB and ADR data can make the job well. First, the AD resolution must be set 12-bit mode and then to execute
ADC converter routine. Then delete the LSB of ADC data and get the new resolution result. The table is as following.
ADC
Resolution
8-bit
ADB
ADB8
ADR
ADB11
O
O
O
O
ADB10 ADB9
ADB7
O
O
O
O
ADB6
O
O
O
O
ADB5
O
O
O
O
ADB4
O
O
O
O
ADB3
x
O
O
O
ADB2
ADB1
ADB0
O
O
O
O
O
O
O
O
O
O
O
O
O
O
O
x
x
O
O
O
x
x
x
O
O
x
x
x
x
O
9-bit
10-bit
11-bit
12-bit
O
O
O
O
O
O
O = Selected, x = Delete
SONiX TECHNOLOGY CO., LTD
Page 97
Revision 0.5