SN8P2200 Series
USB 1.1 Low-Speed 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 72
Version 1.7
7.3
I/O OPEN-DRAIN REGISTER
P1.0/P1.1 is built-in open-drain function. P1.0/P1.1 must be set as output mode when enable P1.0/P1.1 open-drain
function. Open-drain external circuit is as following.
U
MCU2
U
VCC
Open-drain pin
Open-drain pin
MCU1
Pull-up Resistor
The pull-up resistor is necessary. Open-drain output high is driven by pull-up resistor. Output low is sunken by MCU’s
pin.
Note: P1.0/P1.1 open-drain function can be 2
nd
PS/2 interface on chip. More detail information refer to
PS/2 chapter.
0E9H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P1OC
- - - - - -
P11OC
P10OC
Read/Write
- - - - - - W
W
After
reset
- - - - - - 0 0
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
P10M
; Enable P1.0 output mode.
MOV
A, #01H
; Enable P1.0 open-drain function.
B0MOV
P1OC,
A
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.