Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
General-purpose input/output
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Usage== GPIOs are used in a diverse variety of applications, limited only by the electrical and timing specifications of the GPIO interface and the ability of software to interact with GPIOs in a sufficiently timely manner. GPIOs usually employ standard logic levels and cannot supply significant current to output loads. When followed by an appropriate high-current output [[Digital buffer|buffer]] (or mechanical or solid-state relay), a GPIO may be used to control high-power devices such as lights, solenoids, heaters, and motors (e.g., fans and blowers). Similarly, an input buffer, relay or opto-isolator is often used to translate an otherwise incompatible signal (e.g., high voltage) to the logic levels required by a GPIO. Integrated circuit GPIOs are commonly used to control or monitor other circuitry (including other ICs) on a board. Examples of this include enabling and disabling the operation of (or power to) other circuitry, reading the states of on-board switches and configuration shunts, and driving [[light-emitting diode]] (LED) status indicators. In the latter case, a GPIO can, in many cases, supply enough output current to directly power an LED without using an intermediate buffer. Multiple GPIOs are sometimes used together as a [[bit banging]] communication interface. For example, two GPIOs may be used to implement a serial communication bus such as Inter-Integrated Circuit ([[IΒ²C]]), and four GPIOs can be used to implement a [[Serial Peripheral Interface]] (SPI) bus; these are usually used to facilitate serial communication with ICs and other devices which have compatible serial interfaces, such as sensors (e.g., temperature sensors, pressure sensors, [[accelerometer]]s) and [[motor controller]]s. Taken to the extreme, this method may be used to implement an entire parallel bus, thus allowing communication with bus-oriented ICs or circuit boards. Although GPIOs are fundamentally digital in nature, they are often used to control analog processes. For example, a GPIO may be used to control motor speed, light intensity, or temperature. Usually, this is done via PWM, in which the duty cycle of the GPIO output signal determines the effective magnitude of the process control signal. For example, when controlling light intensity, the light may be dimmed by reducing the GPIO duty cycle. Some analog processes require an analog control voltage. In such cases, it may be feasible to connect a GPIO, which is operated as a PWM output, to an RC filter to create a simple, low cost [[digital-to-analog converter]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)