IO
Mode
- Quasi-Bidirectional Mode - The quasi-bidirectional mode, as the standard 8051 I/O structure, can rule as both input and output. When the port outputs a logic high, it is weakly driven, allowing an external device to pull the pin low. When the pin is pulled low, it is driven strongly and able to sink a large current. In the quasi-bidirectional I/O structure, there are three pull-high transistors. Each of them serves different purposes.
- Push-Pull Mode - The push-pull mode has the same pull-low structure as the quasi-bidirectional mode, but provides a continuous strong pull-high when the port latch is written by logic 1. The push-pull mode is generally used as output pin when more source current is needed for an output driving.
- Input-Only Mode - Input-only mode provides true high-impedance input path. Although a quasi-bidirectional mode I/O can also be an input pin, but it requires relative strong input source. Input-only mode also benefits to power consumption reduction for logic 0 input always consumes current from V DD if in quasi-bidirectional mode.
- Open-Drain Mode - The open-drain mode turns off all pull-high transistors and only drives the pull-low of the port pin when the port latch is given by logic 0. If the port latch is logic 1, it behaves as if in input-only mode. To be used as an output pin generally as I2C lines, an open-drain pin should add an external pull-high, typically a resistor tied to V DD . User needs to take care that an open-drain pin with its port latch as logic 1 should be given with a determined voltage level by external devices or resistors. A floating pin will induce leakage current especially in Power-down mode.
Mode | Input | Output |
---|---|---|
Quasi-Bidirectional Mode | Example | yes |
Push-Pull Mode | no | yes |
Open-Drain Mode | yes | no |
Input Mode | yes | no |