mg84fl54 Megawin Technology, mg84fl54 Datasheet - Page 27

no-image

mg84fl54

Manufacturer Part Number
mg84fl54
Description
Full-speed Usb Micro-controller
Manufacturer
Megawin Technology
Datasheet
10. Configurable I/O Ports
10.1. Port Configurations
The device has five I/O ports, Port 0 ~ Port 4. All the port pins can be individually and independently configured
to one of four modes: quasi-bidirectional (standard 8051 I/O port), push-pull output, open-drain output or input-
only (high-impedance). Each port pin is equipped with a Schmitt-triggered input to improve input noise rejection.
Each port has two configuration registers, PxM0 and PxM1, to configure the I/O type for each port pin. Where,
x=0~4.
Table 10-1 Port Configuration Setting
Where x=0~4 (port number), and y=0~7 (port pin).
10.1.1. Quasi-bidirectional
Port pins in quasi-bidirectional mode are similar to the standard 8051 port pins. A quasi-bidirectional port can be
used as an input and output without the need to reconfigure the port. This is possible because when the port
outputs a logic high, it is weakly driven, allowing an external device to pull the pin low. When the pin outputs low,
it is driven strongly and able to sink a large current. There are three pull-up transistors in the quasi-bidirectional
output that serve different purposes.
One of these pull-ups, called the “very weak” pull-up, is turned on whenever the port register for the pin contains
a logic “1”. This very weak pull-up sources a very small current that will pull the pin high if it is left floating.
A second pull-up, called the “weak” pull-up, is turned on when the port register for the pin contains a logic “1”
and the pin itself is also at a logic “1” level. This pull-up provides the primary source current for a quasi-
bidirectional pin that is outputting a 1. If this pin is pulled low by the external device, this weak pull-up turns off,
and only the very weak pull-up remains on. In order to pull the pin low under these conditions, the external
device has to sink enough current to over-power the weak pull-up and pull the port pin below its input threshold
voltage.
The third pull-up is referred to as the “strong” pull-up. This pull-up is used to speed up low-to-high transitions on
a quasi-bidirectional port pin when the port register changes from a logic “0” to a logic “1”. When this occurs, the
strong pull-up turns on for two CPU clocks, quickly pulling the port pin high.
MEGAWIN
PxM0.y
0
0
1
1
PxM1.y
0
1
0
1
Input-Only (High Impedance, Hi-Z)
Open-Drain Output
Quasi-bidirectional
Push-Pull Output
MG84FL54B Data sheet
Port Mode
27

Related parts for mg84fl54