SN8P2604
8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 68
Version 1.1
7.3 I/O OPEN-DRAIN REGISTER
P1.0, P1.1 are built-in open-drain function. P1.0, P1.1 must be set as output mode when enable 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.
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 0
P10OC:
P10 open-drain control bit
0 = Disable open-drain mode
1 = Enable open-drain mode
Bit 1
P11OC:
P11 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.