SN8F2280 Series
USB 2.0 Full-Speed 8-Bit Micro-Controller
7.3 I/O OPEN-DRAIN REGISTER
P1.0/P1.1/P0.6/P0.5 is built-in open-drain function. P1.0/P1.1/P0.6/P0.5 must be set as output mode when enable
P1.0/P1.1/P0.6/P0.5 open-drain function. Open-drain external circuit is as following.
MCU1
U
MCU2
U
VCC
Pull-up Resistor
Open-drain pin
Open-drain pin
The pull-up resistor is necessary. Open-drain output high is driven by pull-up resistor. Output low is sunken by MCU’s
pin.
0E9H
P1OC
Read/Write
After reset
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
P06OC
W
Bit 2
P05OC
W
Bit 1
P11OC
W
Bit 0
P10OC
W
-
-
-
-
-
-
-
-
-
-
-
-
0
0
0
0
Bit [3:2] P0nOC: Port 0 open-drain control bit
0 = Disable open-drain mode
1 = Enable open-drain mode
Bit [1:0] P1nOC: Port 1 open-drain control bit
0 = Disable open-drain mode
1 = Enable open-drain mode
¾
Example: Enable P1.0 to open-drain mode and output high.
B0BSET
P1.0
; Set P1.0 buffer high.
B0BSET
MOV
B0MOV
P10M
A, #01H
P1OC, A
; Enable P1.0 output mode.
; Enable P1.0 open-drain function.
¾
Note: P1OC is write only register. Setting P10OC must be used “MOV” instructions.
Example: Disable P1.0 to open-drain mode and output low.
MOV
A, #0
; Disable P1.0 open-drain function.
B0MOV
P1OC, A
Note: After disable P1.0 open-drain function, P1.0 mode returns to last I/O mode.
SONiX TECHNOLOGY CO., LTD
Page 82
Version 1.1