Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

Increasing Digital I/O Pins of Arduino uno Using 8255 Peripheral Programmable Interface with Arduino

By EG Projects July 17, 2019

FacebookXLinkedInRedditPinterestShare
In this tutorial i am going to teach you how to increase(add) digital I/O (Input-Output) Pins of Arduino uno. Their are normally 14 (0-13) Digital Pins on Arduino & 6 (0-5) Analog pins on Arduino uno. Some times your application needs more digital pins than available on the Arduino board. For example you want to connect an lcd and a 4×4 keypad with arduino & you want to use lcd in 8-bit Mode. Now 14 pins are not enough to connect both the lcd and keypad with arduino. You need some extra pins to carry out the task.

LCD is comprised of 8 data pins and 3 control pins(rs,rw,en) Total 8+3=11. Keypad 4×4 contains 4 Rows and 4 Coulombs Total 4+4=8. Now for this scenario given above you need Total 11+8=19 Pins and arduino uno only have 12 digital input output pins. So we have to add some more pins to arduino.

Increasing digital I/O pins of Arduino – Solution

The best solution is to use 8255 chip with Arduino. 8255 is a  Programmable Peripheral Interface. It comes in 40 Pin DIP Package. It has Three 8-bit Input-Output Ports A, B & C. Total I/O pins becomes 8×3=24. All The three ports can be used as I/O. Port A & B of 8255 can only be used as 8-bit input-Output Port. But Port C individual bits can be used as general purpose I/O pins. 8255 adds 24 new digital input output pins to arduino uno board. 
Intel 8255 PPI Pin out, ports and control pins

Intel 8255 PPI Pin out, ports and control pins

Full Description of the chip with control information is available in the link below. Its impossible to cover all of the aspects of 8255 here. So it is provided in an another tutorial. I recommend you to please go through the link other wise you can not understand the code below and interfacing of 8255 with arduino Microcontroller.

  • 8255 Pinout, Working and Configuration Description.​

Increasing arduino digital pins with 8255 diy project

Lets start with a simple project on how to blink led’s by interfacing 8255 with arduino uno. Led’s are connected to Port-B of 8255 Chip. Port-A & C are not used here. Data pins of 8255 are connected to Digital I/O Pins 0-7 of Arduino. Port Selection bits (A0-A1) of 8255 are connected to Pin 9 & 10 of Arduino. Read & Write pins of 8255 are connected to 11 and 12 pins of Arduino. CS(Chipselect) is Grounded. Grounding this pin will select the chip working mode. RESET is also grounded because we dont want to reset the chip. Applying a small +Positive Pulse at this pin will reset the chip and you have to start from beginning, loading Control Word etc. Circuit diagram of the project is given below.
Increasing Digital I/O of Arduino - 8255 interfacing with Arduino - Circuit Diagram

Increasing Digital I/O of Arduino – 8255 interfacing with Arduino – Circuit Diagram

Increasing digital input/output pins of arduino code

Coming to the code portion. First individual pins of arduino are defined to control 8255 chip. Then i defined the individual I/O pins as output in setup() Function. Because i only want to write to Port-B of 8255. In the main function i first disabled read & write. Selected control register of 8255. Loaded control word in control register of 8255. Which set’s all Three Ports of 8255 as output port. Then i enabled write. Enabling write will write my control word in control register of 8255. Then selected Port-B. Made all Pins of Port-B high. After half a second i made Port-B pins low. This continuous High and Low will blink my leds connected to Port-B of 8255 chip.
8255 with Arduino, Increasing Digital I/O of Arduino  - Circuit Diagram

8255 with Arduino, Increasing Digital I/O of Arduino – Circuit Diagram

Note: You can also use Arduino DDR & PORTD register for pins(0-7). Taking this step will reduce your code statements. 
const int a0=9;
const int a1=10;
const int WR=11;
const int RD=12;
void setup()
{
pinMode(0,OUTPUT);pinMode(1,OUTPUT);
pinMode(2,OUTPUT);pinMode(3,OUTPUT);
pinMode(4,OUTPUT);pinMode(5,OUTPUT);
pinMode(6,OUTPUT);pinMode(7,OUTPUT);
pinMode(a0,OUTPUT);pinMode(a1,OUTPUT);
pinMode(WR,OUTPUT);pinMode(RD,OUTPUT);
}
void loop(){
digitalWrite(RD,1); //Disabling READ
digitalWrite(WR,1); //Disabling WRITE
digitalWrite(a0,1); //Selecting Control Register of 8255
digitalWrite(a1,1); //Selecting Control Register of 8255
digitalWrite(7,1); //
digitalWrite(6,0); //
digitalWrite(5,0); //
digitalWrite(4,0); // 8255 All Ports as OUTPUT
digitalWrite(3,0); //
digitalWrite(2,0); //
digitalWrite(1,0); //
digitalWrite(0,0); //
digitalWrite(WR,0); //Enabling WRITE
delay(500);
digitalWrite(WR,1); //Disabling WRITE
digitalWrite(a0,1); //Port B is selected
digitalWrite(a1,0); //Port B is selected
digitalWrite(0,1); //
digitalWrite(1,1); //
digitalWrite(2,1); //
digitalWrite(3,1); //
digitalWrite(4,1); //Port-B all pins high
digitalWrite(5,1); //
digitalWrite(6,1); //
digitalWrite(7,1); //
digitalWrite(WR,0); //WRITE ENABLED
delay(500);
digitalWrite(WR,1); //WRITE Disabled
digitalWrite(0,0); //
digitalWrite(1,0); //
digitalWrite(2,0); //
digitalWrite(3,0); //
digitalWrite(4,0); //Port-B all pins LOW
digitalWrite(5,0); //
digitalWrite(6,0); //
digitalWrite(7,0); //
digitalWrite(WR,0); //WRITE Enabled
delay(1000);
digitalWrite(WR,1); //Deselecting WRITE
}
view raw increasing-digital-io-of-arduino.ino hosted with ❤ by GitHub
Download the project files .ino, Code(c,HEX) and simulation. Simulation is made in Proteaus 8.0. For simulation execution you first have to install arduino library in Proteaus because proteaus didn’t have pre-installed arduino library to debug Arduino projects. Give us your feed back on the project. In the next Phase i am going to develop standard library for increasing digital I/O of Arduino board Microcontroller with proper Hardware circuit.

Increasing Digital I/O of Arduino Code/Files


Filed Under: Arduino Projects, Microcontroller Projects

 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: EMC/EMI
EE World has assembled a collection of articles that demonstrate how to measure emissions with simple antennas. We include a review of a handheld spectrum analyzer. We also look at EMC issues with IoT devices.

EE Learning Center

“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


EDABOARD.com Discussions

  • Hall sensor circuit
  • epe project vu meter
  • using a coupler in non tradiotional way question
  • Question Wi-fi USB for pc
  • Error ambiguous command 'get_cell' matched 3 commands

Electro-Tech-Online.com Discussions

  • 52v indicator Kit - trying to add a piezo when signalling
  • STM8S001J3 PCB Design
  • Engine pressure alarm for variable RPM
  • anyone recognizes this laser diode?
  • Press n Peel Blue Paper issues

Featured – Real Time Hardware Filter Design

  • Practical implementation of bandpass and band reject filters
  • Practical application of hardware filters with real-life examples
  • A filter design example
  • Types of filter responses
  • What are the two types of hardware filters?
  • What are hardware filters and their types?

Recent Articles

  • What is an M2M IoT network?
  • Nuvoton audio amplifier features 80 dB PSRR and 2.1 mA quiescent Current
  • What are the different types of IoT networks?
  • Stackpole introduces metal element jumpers for high current application
  • Knowles introduces 125 °C rated DC link capacitors

EE ENGINEERING TRAINING DAYS

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe
✓
Thanks for sharing!
AddToAny
More…