
M0A21/M0A23 Series
May 06, 2022
Page
240
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
Port Pin
Port Pin
N
N
Port Latch Data
Port Latch Data
Input Data
Input Data
V
DD
V
DD
Pull-up Enable
Pull-up Enable
P
P
R
R
Figure 6.5-4 Open-Drain Output
Quasi-bidirectional Mode
Figure 6.5-5 shows the diagram of Quasi-bidirectional Mode. Set MODEn (Px_MODE[2n+1:2n]) to 11
as the Px.n pin is in Quasi-bidirectional mode and the I/O pin supports digital output and input function
at the same time but the source current is only up to hundreds uA. Before the digital input function is
performed the corresponding DOUT (Px_DOUT[n]) bit must be set to 1. The quasi-bidirectional output
is common on the 80C51 and most of its derivatives. If the bit value in the corresponding DOUT
(Px_DOUT[n]) bit is 0, the pin drive a low output on the pin. If the bit value in the corresponding DOUT
(Px_DOUT[n]) bit is 1, the pin will check the pin value. If pin value is high, no action takes. If pin state is
low, the pin will drive strong high with 2 clock cycles on the pin and then disable the strong output drive.
Meanwhile, the pin status is controlled by internal pull-up resistor. Note that the source current capability
in quasi-bidirectional mode,please refer to the M0A21/M0A23 Datasheet for detailed information.
Port Pin
Port Pin
N
N
P
P
V
DD
V
DD
Port Latch Data
Port Latch Data
Input Data
Input Data
2 CPU
Clock Delay
P
P
P
P
Strong
Strong
Very
Weak
Very
Weak
Weak
Weak
Figure 6.5-5 Quasi-Bidirectional I/O Mode
GPIO Interrupt and Wake-up Function
Each GPIO pin can be set as chip interrupt source by setting correlative RHIEN (Px_INTEN[n+16])/
FLIEN (Px_INTEN[n]) bit and TYPE (Px_INTTYPE[n]). There are five types of interrupt condition can be
selected: low level trigger, high level trigger, falling edge trigger, rising edge trigger and both rising and