SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
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
P0M
Read/Write
After reset
Bit 7
Bit 6
P06M
R/W
0
Bit 5
P05M
R/W
0
Bit 4
Bit 3
P03M
R/W
0
Bit 2
P02M
R/W
0
Bit 1
Bit 0
P00M
R/W
0
-
-
-
-
-
-
-
-
-
0C1H
P1M
Read/Write
After reset
Bit 7
Bit 6
P16M
R/W
0
Bit 5
P15M
R/W
0
Bit 4
P14M
R/W
0
Bit 3
P13M
R/W
0
Bit 2
P12M
R/W
0
Bit 1
P11M
R/W
0
Bit 0
P10M
R/W
0
-
-
-
0C4H
P4M
Read/Write
After reset
Bit 7
P47M
R/W
0
Bit 6
P46M
R/W
0
Bit 5
P45M
R/W
0
Bit 4
P44M
R/W
0
Bit 3
P43M
R/W
0
Bit 2
P42M
R/W
0
Bit 1
P41M
R/W
0
Bit 0
P40M
R/W
0
Bit[7:0]
PnM[7:0]: Pn mode control bits. (n = 0~4).
0 = Pn is input mode.
1 = Pn is output mode.
Note:
1.
2.
Users can program them by bit control instructions (B0BSET, B0BCLR).
P0.4 input pin only, and the P0M.4 is undefined
Example: I/O mode selecting
CLR
CLR
P0M
P4M
; Set all ports to be input mode.
; Set all ports to be output mode.
MOV
B0MOV
B0MOV
A, #0FFH
P0M, A
P4M,A
B0BCLR
B0BSET
P4M.0
P4M.0
; Set P4.0 to be input mode.
; Set P4.0 to be output mode.
SONiX TECHNOLOGY CO., LTD
Page 69
Version 2.0