SN8P2711A
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 73
Version 0.1
7
7
7
I/O PORT
7.1 I/O PORT MODE
The port direction is programmed by PnM register. All I/O ports can select input or output direction.
0B8H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P0M
- - - -
P03M
P02M
P01M
P00M
Read/Write
- - - -
R/W
R/W
R/W
R/W
After
reset
- - - - 0 0 0 0
0C4H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P4M
-
-
-
P44M P43M P42M P42M P40M
Read/Write
-
-
- R/W R/W R/W R/W R/W
After
reset
- - - 0 0 0 0 0
0C5H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P5M
- - -
P54M
P53M
- - -
Read/Write
- - -
R/W
R/W
- - -
After
reset
- - - 0 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. P0.4 input only pin, and the P0M.4 keeps “1”.
¾
Example: I/O mode selecting
CLR
P0M
; Set all ports to be input mode.
CLR
P4M
CLR
P5M
MOV
A, #0FFH
; Set all ports to be output mode.
B0MOV
P0M,
A
B0MOV
P4M,A
B0MOV
P5M,
A
B0BCLR
P4M.0
; Set P4.0 to be input mode.
B0BSET
P4M.0
; Set P4.0 to be output mode.