Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are GPIOs used?

I have been searching around [in vain] for some good links/sources to help understand GPIOs and why they are used in embedded systems. Can anyone please point me to some ?

like image 680
Bandicoot Avatar asked Feb 13 '11 23:02

Bandicoot


People also ask

What is the main purpose of GPIOs?

A General Purpose Input/output (GPIO) is an interface available on most modern microcontrollers (MCU) to provide an ease of access to the devices internal properties. Generally there are multiple GPIO pins on a single MCU for the use of multiple interaction so simultaneous application.

Why do I need GPIO pins?

When configured as input, we can read the signal on that pin. GPIO is the standard interface through which a microcontroller can communicate with the external world. It can be used to read values from analog or digital sensors, drive a led, drives clock for I2C communication, etc.

What is use of GPIO in IoT?

Gpio namespace to allow apps to set, read, and react to state changes in the General Purpose Input/Output (GPIO) pins on a Windows IoT (Internet of Things) device. These pins are often used to access sensors, motors, LEDs, etc. Note: This sample is part of a large collection of UWP feature samples.

How does a GPIO pin work?

A GPIO pin is a generic pin whose value consists of one of two voltage settings (high or low) and whose behavior can be programmed through software. A GPIO port is a platform-defined grouping of GPIO pins (often 4 or more pins).


1 Answers

In any useful system, the CPU has to have some way to interact with the outside world - be it lights or sounds presented to the user or electrical signals used to communicate with other parts of the system. A GPIO (general purpose input/output) pin lets you either get input for your program from outside the CPU or to provide output to the user.

Some uses for GPIOs as inputs:

  • detect button presses
  • receive interrupt requests from external devices

Some uses for GPIOs as outputs:

  • blink an LED
  • sound a buzzer
  • control power for external devices

A good case for a bidirectional GPIO or a set of GPIOs can be to "bit-bang" a protocol that your SoC doesn't provide natively. You could roll your own SPI or I2C interface, for example.

like image 122
Carl Norum Avatar answered Oct 26 '22 18:10

Carl Norum