SN8P2501D
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 64
Version 1.5
7.4 I/O OPEN-DRAIN REGISTER
P1.0 is built-in open-drain function. P1.0 must be set as output mode when enable P1.0 open-drain function.
Open-drain external circuit is as following.
U
M CU2
U
VCC
Open-drain pin
Open-drain pin
M CU1
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.
0E9H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
P1OC
-
-
-
-
-
-
-
P10OC
Read/Write
-
-
-
-
-
-
-
W
After reset
-
-
-
-
-
-
-
0
Bit 0
P10OC:
P1.0 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.