SN8P2714X_2715
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 98
V1.4
The AIN’s input voltage v.s. ADB’s output data
AIN n
ADB1
1
ADB10 ADB9 ADB8 ADB7 ADB6 ADB5 ADB4 ADB3 ADB2 ADB1 ADB0
0/4095*AVREFH
0 0 0 0 0 0 0 0 0 0 0 0
1/4095*AVREFH
0 0 0 0 0 0 0 0 0 0 0 1
.
. . . . . . . . . . . .
.
. . . . . . . . . . . .
.
. . . . . . . . . . . .
4094/4095*AVREFH
1 1 1 1 1 1 1 1 1 1 1 0
4095/4095*AVREFH
1 1 1 1 1 1 1 1 1 1 1 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.
ADB ADR
ADC
Resolution
ADB11 ADB10 ADB9 ADB8
ADB7
ADB6
ADB5
ADB4
ADB3 ADB2 ADB1
ADB0
8-bit
O O O O O O O O x x x x
9-bit
O O O O O O O O O x x x
10-bit
O O O O O O O O O O x x
11-bit
O O O O O O O O O O O x
12-bit
O O O O O O O O O O O O
O = Selected, x = Delete
11.5 P4CON REGISTERS
ADB initial value = 0000 0000
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
W W W W W W W W
The Port 4 is shared with ADC input function. 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
leakage current will be a big issue. 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.
Bit[7:0]
P4CON [7:0]
Port4 Configuration register.
0 = P4.X can be an analog input (ADC input) or digital I/O pins.
1 = P4.X is pure analog input, can’t be a digital I/O pin.
Note: When Port4 [7:0] is general I/O port not ADC channel, P4CON [7:0] must set to “0” or the Port4
input signal would be isolated