SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 62
Version 1.5
7.2 I/O PORT MODE
The port direction is programmed by PnM register. When the bit of PnM register is
“0”, the pin is input mode. When the
bit of PnM register is
“1”, the pin is output mode.
0B8H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P0M
-
-
-
-
-
-
-
P00M
Read/Write
-
-
-
-
-
-
-
R/W
After reset
-
-
-
-
-
-
-
0
0C1H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P1M
-
-
-
-
P13M
P12M
-
P10M
Read/Write
-
-
-
-
R/W
R/W
-
R/W
After reset
-
-
-
-
0
0
-
0
0C2H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P2M
-
-
P25M
P24M
P23M
P22M
P21M
P20M
Read/Write
-
-
R/W
R/W
R/W
R/W
R/W
R/W
After reset
-
-
0
0
0
0
0
0
0C5H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P5M
-
-
-
P54M
-
-
-
-
Read/Write
-
-
-
R/W
-
-
-
-
After reset
-
-
-
0
-
-
-
-
Bit[7:0]
PnM[7:0]:
Pn mode control bits. (n = 0~5).
0 = Pn is input mode.
1 = Pn is output mode.
Note:
1.
Users can program them by bit control instructions (B0BSET, B0BCLR).
2.
P1.1 input pin only, and the P1M.1 is undefined.
Example: I/O mode selecting
CLR
P0M
; Set all ports to be input mode.
CLR
P2M
CLR
P5M
MOV
A, #0FFH
; Set all ports to be output mode.
B0MOV
P0M, A
B0MOV
P2M,A
B0MOV
P5M, A
B0BCLR
P2M.0
; Set P2.0 to be input mode.
B0BSET
P2M.0
; Set P2.0 to be output mode.