Skip to main content

The General Purpose Input/Output.



The GPIO is one of the most frequently encountered acronyms in the embedded domain. It stands for General Purpose Input/Output and exactly does the same thing i.e either it is used to take input or to give output. These are hardware lines which are general purpose in the sense that they are not specifically used for only one functionality by any peripheral. For example, if any MCU contains 8 Gpio’s then one at any given instance one Gpio may be used in taking input from a button, other may be used to give output to an LED and the next one may be used to communicate with other MCU.So by using these Gpio’s an MCU can give/take instructions/inputs from other electronic components such as LED’s, buttons, sensors etc.
In a nutshell, the Gpio’s are the mediators through which the internal peripherals such as the different communication protocols, Timers, analog to digital converters can perform there functionalities. In the case of an ADC(Analog to digital converter), It requires analog data to be given as input and converts it into digital(binaries). So the Gpio’s are used to take the analog data as input. This functionality of a Gpio is known as Alternate Functionality as the Gpio is taking the input for another peripheral.
GPIO pins have no predefined purpose and the user has to define the purpose of a particular Gpio. A GPIO port is a group of GPIO pins arranged in a group and controlled as a group. The Gpio’s often have the pull-up and pull-down functionality. The pull-up means connecting a Gpio pin to +Vcc through a resistor and The pull-down means connecting a Gpio pin to Ground through a resistor. These resistors are called Pull up/down resistors. This is an important concept as there are many scenarios in which the user wants to take input from a button.so when the button is pressed the Gpio is connected to Ground and the user can turn on an led as soon as the Gpio’s input becomes low But there lies a problem in such a design as if the Button is not pressed the Gpio is neither connected to Ground nor to +Vcc. This state is known as Floating state as the Gpio now takes the surrounding noise as input and may take a logic 0 reading even when the button is not pressed. So as to counter this scenario, If the pull-up resistor is used then until the button is not pressed the Gpio will stay connected to +Vcc and as soon as the button is pressed it gets connected to ground and hence provides a clean State change.


The Gpio’s will be used in most of the upcoming blogs and if still, their use is not clear to the readers then it will be understood in the near future.

Comments

Popular posts from this blog

Let's Build a Music Player!

Digital Music Player's are one of the many sensational devices that were developed in the 20th century. They have been around for a while now and have become a part of our life. In the last few years, they have been integrated within Smart Phones and hence, have reached the masses. Now, Let us try to dive into knowing how these devices work and I guarantee that we all would be fascinated by the kind of engineering which goes into making these magic boxes. There are various topics which must be covered in order to build our own music player and so there will be several blogs to build a SOUND foundation. Now let us make a list of the required components and then we will walk through each of them in the upcoming blogs. There are 3 basic parts which are required to build a device which can output Audio:- Storage Medium. Micro-controller. Audio Output device. We will store the required music file onto a storage medium as the onboard memory on a microcontroller is low...

SD-CARD

This Post marks the beginning of our quest to develop a simple Music player. SD stands for Secure digital and these small devices have been around for a while now. They contain flash memory and a memory controller which is given instruction by the main MCU. So our main objective here is to understand how sd cards work and how to interface them with a microcontroller. As to understand the working of SD card we need to dive into the world of transistors and bits! The Sd card contains solid-state memory also known as the flash memory which is a type of EEPROM i.e  Electronically Erasable Programmable Read Only Memory .  Flash memory stores information in an array of memory cells made from  floating-gate transistors . These transistors are used in different topologies as to store each bit. We will not program each bit individually as it will be time-consuming as well as an inefficient way to store the data. As to move to a higher level of abstraction, we need a way to ...

Automated Outdoor Lighting

This Project enables a person to make any Outdoor Lighting Automated i.e to switch On/Off according to the sunlight outside. If it is dark outside then the light will turn On and if it is daytime then it will automatically switch Off. This can be very useful for all Outdoor Lighting of various commercial buildings as well as for residential buildings. This can also be implemented in Vehicles which will automatically turn their lights On.  Our aim can be achieved by designing a proper transistor circuit and using a relay with it to control the high voltage network. T he Requirements Are: 1:- Bipolar Transistor(Bc 547) 2:-5/6v Spdt Relay 3:-Resistors(Around 4.5k And 3k Ohm) 4:-Light Dependent Resistor 5:-5v Power Supply 6:-Pcb For Soldering Things Together 7:-Multimeter          CIRCUIT AND EXPLANATION The project involves the use of a transistor as a switch to make the outdoor light on/off. As we know that transistor can be used in three diffe...