SN8P1602B
8-Bit Micro-Controller
I/O PORT FUNCTION TABLE
ꢀ
SN8P1602B
Port/Pin
P0.0
I/O
Function Description
General-purpose input function
External interrupt (INT0)
Wakeup from power down mode
General-purpose input/output function
Wakeup from power down mode
General-purpose input/output function
Remark
I
See <P00G1,P00G0>
See <P00G1,P00G0>
P1.0~P1.4
P2.0~P2.7
I/O
I/O
Level Change
ꢀ
Note: The P1.4 enables when the external oscillator is RC type.
I/O PORT MODE
The port direction is programmed by PnM register. Port 0 is always input mode. Port 1 and Port 2 can select input or
output direction.
ꢀ
SN8P1602B
0C1H
P1M
Bit 7
0
-
Bit 6
0
-
Bit 5
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
Read/Write
After reset
-
-
-
ꢀ
SN8P1602B
0C2H
P2M
Bit 7
P27M
R/W
0
Bit 6
P26M
R/W
0
Bit 5
P25M
R/W
0
Bit 4
P24M
R/W
0
Bit 3
P23M
R/W
0
Bit 2
P22M
R/W
0
Bit 1
P21M
R/W
0
Bit 0
P20M
R/W
0
Read/Write
After reset
When PnM=0, the Pn is input mode
PnM=1, the Pn is output mode
ꢀ
Users can program them by bit control instructions (B0BSET, B0BCLR).
ꢁ
Example: I/O mode selecting
CLR
CLR
P1M
P2M
; Set all ports to be input mode.
; Set all ports to be output mode.
MOV
B0MOV
B0MOV
A, #0FFH
P1M, A
P2M, A
B0BCLR
B0BSET
P1M.2
P1M.2
; Set P1.2 to be input mode.
; Set P1.2 to be output mode.
SONiX TECHNOLOGY CO., LTD
Page 61
Version 1.2