SN8P1700
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 161
Revision 1.93
I/O PORT MODE
The port direction is programmed by PnM register. Port 0 is always input mode. Port 1,2,4 and 5 can select input or
output direction.
P1M initial value = xx00 0000
0C1H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P1M
0
0
P15M P14M P13M P12M P11M P10M
- -
R/W
R/W
R/W R/W R/W R/W
P10M~P15M: P1.0~P1.5 I/O direction control bit. 0 = input mode, 1 = output mode.
P2M initial value = 0000 0000
0C2H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P2M
P27M P26M P25M P24M P23M P22M P21M P20M
R/W R/W R/W R/W R/W R/W R/W R/W
P20M~P27M: P2.0~P2.7 I/O direction control bit. 0 = input mode, 1 = output mode.
P4M initial value = 0000 0000
0C4H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P4M
P47M P46M P45M P44M P43M P42M P41M P40M
R/W R/W R/W R/W R/W R/W R/W R/W
P40M~P47M: P4.0~P4.7 I/O direction control bit. 0 = input mode, 1 = output mode.
P5M initial value = 0000 0000
0C5H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P5M
P57M P56M P55M P54M P53M P52M P51M P50M
R/W R/W R/W R/W R/W R/W R/W R/W
P50M~P57M: P5.0~P5.7 I/O direction control bit. 0 = input mode, 1 = output mode.
The each bit of PnM is set to “0”, the I/O pin is input mode. The each bit of PnM is set to “1”, the I/O pin is output mode.
Input mode is with pull-up resistor controlled by setting @SET_UP macro. The output mode disables the pull-up
resistors no matter pull-up resistors is set or not.
The PnM registers are read/write bi-direction registers. Users can program them by bit control
instructions (B0BSET, B0BCLR).