📔
Notes
  • Embedded systems
    • GPIO concepts
    • 📈SPI protocol
    • 📈I2C Protocol
    • 📈UART Protocol
    • 📈CAN Protocol
    • 📈DMA
  • FreeRTOS / RTOS
    • Basics
    • Stm32 FreeRTOS setup
  • Interview Questions
    • Basic C
    • Electronics / mcu
  • Hardware design
  • C programming
  • C++ programming
    • Basics
  • Data structure and Algorithms
    • Data Structures in C
  • Design Patterns
  • Algorithms
  • OS concepts
  • VLSI
  • DSP
  • Motors and sensors
    • BLDC motor
  • Important/ intersting documents
Powered by GitBook
On this page
  • Introduction
  • Input Confiiguration:
  • Output Configuration:
  1. Embedded systems

GPIO concepts

Notes on GPIO concepts

PreviousEmbedded systemsNextSPI protocol

Last updated 2 years ago

Introduction

  • MCUs have PORTS and PINS , PORTS are a collection of PINS and each PIN has a functionality thats assigned by the manufacturer

  • GPIO is used as switch , interrupts , in SPI as CS etc

  • GPIO - General Purpose Input Output has the below structure

Input Confiiguration:

  • PIN of an MCU can be configured as Input with pullup or pulldown resistors

  • Why pullup or pulldown ? Because if a PIN doesnt have a internal pullup or extenal pullup/down activated then it will be in floating state when nothing is connected and this will lead to wrong input read values

  • floating state can also cause leakage current (the mosfets will turn on partially and the current will leak)

Output Configuration:

  • Output PIN can be in open drain (pulled low when 0 but floating when 1) so it requires an external pullup resistor (use this when the current to be sourced needs to be higher than what mosfet / PIN can source)

  • Output PIN can be in Push pull configuration and this doesnt require a pullup resistor