General purpose input output

What does GPIO(General purpose input output) mean?

What does GPIO(General purpose input output) mean? - Table of contents:

GPIO stands for General purpose input output. It’s a standard interface used to connect microcontrollers to other electronic devices.

For example, it can be used with sensors, diodes, displays, and System-on-Chip modules. Estimote Location Beacons (Hardware Revision F2.3 and later) are equipped with GPIO.

It allows for providing an external power supply, remote control of connected devices, broadcasting more contextual data, or defining contents for custom Bluetooth data packets.

General purpose input output

Input Mode

Typically, GPIO inputs are primarily configured in one of three ways:

  • High Impedance(Hi-Z, also known as floating)
  • Pull-up (Internal resistor connected to VCC)
  • Pull-down (Internal resistor connected to ground)

When the Input port is in high-impedance mode, if there is no external signal source coming in, it is impossible to determine the state of the port at this time (can not determine whether it is at high potential or low potential), unless there is an external signal to drive the circuit. In other words, Input floating, the input potential state is completely determined by external signals, if there is no signal drive, it will show a high impedance state.

If we need this port to have a clear preset state, we must use the pull-up (pull-down) resistor to make adjustments. In the pull-up resistor (pull-up external high voltage, pull-down is usually grounded) Under the action, the port is maintained at a clear high voltage state (pull-down is to maintain the port at a low voltage state).

General purpose input output

As for the size of the specific resistor, it is generally described in detail in the chip manual. In the actual configuration, in addition to the size of the pull-up and pull-down resistors in the port, the influence of the peripheral circuits of the MCU also needs to be considered.

Output Mode

Common GPIO output modes are Open-Drain, Push-Pull, and Open-Collector. Among them, open-drain output and open-collector output, the principles and characteristics of these two outputs are basically similar, the difference is that one uses a MOS tube, and the “drain” in it refers to the drain of the MOS tube; the other uses a triode, of which The “set” refers to the collector of the triode.

General purpose input output

Push-pull output:

Generally, it means that two MOSFETs are respectively controlled by two complementary signals, and the other MOS transistor is always turned off when one MOS transistor is turned on. (The biggest feature of the push-pull output is that it can really output high and low levels, and it has driving capabilities at both levels).

  • Push – When an internal signal connected to the gate of the transistor is set to a low logic level (logic 0), the PMOS transistor is activated and current flows from VDD to the output pin. NMOS transistors are inactive (open circuit) and do not conduct.
  • Pull – When an internal signal connected to the gate of the transistor is set to a high logic level (logic 1), the NMOS transistor is activated (closed) and current starts flowing from the output pin to GND. Meanwhile, the PMOS transistor is inactive (open circuit) and does not conduct current. It seems that the push-pull output is perfect, and it has a pretty good output capability for high and low levels. However, one disadvantage of the push-pull output is that if two push-pull output structures are connected together, one outputs a high level, that is, the upper MOS is turned on, and the lower MOS is closed; at the same time, the other outputs a low level, that is, the upper When the MOS is closed, the lower MOS is turned on. The current will flow directly from the VCC of the first pin through the upper MOS to the lower MOS of the second pin to GND. The resistance in the whole path is very small, and a short circuit will occur, which may cause damage to the port. This is why the push-pull output cannot achieve “wired-AND”.
General purpose input output

Open-drain output:

As the name suggests, it is a circuit that outputs from the drain of the MOSFET. To obtain a high-level state, a pull-up resistor is required. It is suitable for current-type driving, and its ability to absorb current is relatively strong (the main characteristic of open-drain output is that it has no driving ability at a high level, and it needs an external pull-up resistor to truly output a high level).

An obvious advantage of this feature of the open-drain output is that the output level can be easily adjusted because the output level is completely determined by the power supply level connected to the pull-up resistor. So it is very suitable to use open-drain output where level shifting is required.

Open-drain outputs are most commonly used in communication interfaces where multiple devices are connected on the same wire (e.g. I2C, etc.). When all outputs of devices connected to the line are in the Hi-Z state, the line is driven to a default logic 1 level by a pull-up. Any device can pull the line to logic 0 using its open-drain output, and all devices see this level.

What are GPIO(General purpose input output) used for?

The most common use of GPIO is to operate the industrial pc panel. Whether you’re building your own robotic arm or a DIY weather station, the GPIO interface lets you customize the signals so they properly operate your device.

GPIO interfaces are often used with “breadboards”. A breadboard is a temporary circuit board. You can prototype circuits by adding, removing, or moving electronic components. Some advanced Raspberry Pi kits come with an integrated breadboard.

Another popular device with GPIO capabilities is the Arduino microcontroller. This is not a full computer like the Raspberry Pi, but a programmable device designed specifically to control other devices.

Unmarked pictures come from Internet, and source:

GPIO stands for General Purpose Input/Output. It’s a standard interface used to connect microcontrollers to other electronic devices.
Three modes: Open-Drain Output, Push-Pull Output, and Open-Collector Output.