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

Interfacing 24×2 lcd with 8051(89c51,89c52) and microchip pic16f877 microcontroller

By EG Projects May 23, 2019

In this post i am going to explain how to interface 24×2 lcd with microcontroller. I am going to interface lcd with 8051(89c51,89c52) and Microchip Pic16f877 microcontrollers. 24×2 means 24-Coulombs and 2-Rows. Total characters which we can display on 24×2 lcd  (24×2=48) 48. 24 Characters on each row. Interfacing 24×2 lcd with microcontroller is same as we interface other character lcds with microcontrollers. 24×2 lcds are controlled by hd44780 controller, the same controller used to control 8×1,16×2,20×2 lcds. Commands to initialize 24×2 lcd are same used to initialize other character lcds. Registers of lcd are also same. Data read and write process is also same.

About Lcd

Lcd which i am using is from Samsung. Its number is unknown. Only a number UC24202, GNAR4PA, 010429, is written on its back. Also it is mentioned “Made in China” 😀 I found this lcd on an old control system panel. Control panel is out of use so i removed this lcd from the panel and used it in my diy project. I could not found the lcd pin out on internet. I managed to locate the pin names by mapping the header with standard character lcd’s .
24x2 lcd from samsung, UC24202

24×2 lcd from samsung, UC24202, GNAR4PA, 010429,

Interfacing 24×2 lcd with 8051(89c51,89c52) microcontroller

Interfacing 24×2 lcd with 8051(89c51,89c52) microcontroller is an easy task. If you already interfaced any character lcd with 8051(89c51,89c52) microcontroller you can easily interface 24×2. But if you don’t then below are some small tutorials on lcds which will help you in understanding how to interafce and display characters on character lcd’s.

  • Character Lcd pin out and Working.
  • How to display text on Character lcd.

I am going to display ‘ABC’ Alphabets on lcd. First Row of lcd will display Upper case Characters and on second row lower case alphabets will be displayed, up to ‘X’. Displaying text on lcd is not a hard task. Tutorial How to display text on character lcd is very helpful resource in order to carry out this task. I recommend you to please take the tutorial(Link given above the paragraph). 

24x2 lcd interfacing with 8051(89c51,89c52) microcontroller

24×2 lcd interfacing with 8051(89c51,89c52) microcontroller

Lcd data pins are connected to Port-1 of 89c51 microcontroller. Lcd controlling pins en(Enable) is connected to Port-3 pin#7, rw(Read/Write) is connected to Port-3 Pin#6 and rs(Register select) is connected to Port-3 Pin#5. delay function is used to generate some arbitrary delay. In main function a and b variables are initially initialized with ‘A’ and ‘a’, and are incremented one by one to display whole ‘AbC’ alphabets on lcd. 

Interfacing 24×2 lcd with Microchip Pic16f877 Microcontroller


Interfacing 24×2 lcd with pic16f877 microcontroller is same like interfacing it with 8051(89c51). The only difference is in the ports. 8051 has Ports-1,2,3&4, where as pic has Ports-A,B,C,D & E. I am interfacing lcd in 8-bit mode with pic 16f877. Port-B of Pic16f877 is connected to data pins of lcd. Lcd controlling pins en(enable) is connected to Port-D Pin#7,Rs(Register select) is connected to Port-D pin#6, Rw(Read-Write) is connected to Port-D Pin#5. Circuit diagram of the project is given below. 
Code is also same like 8051(89c51). The difference is in libraries 89c51 is programmed using keil Compiler, where as pic is programmed using high tech c compiler. Both compilers need different libraries to compile the code. Main function code is also similar to the 89c51 microcontroller main function code.
Interfacing 24x2 character lcd with Pic 16f877 microcontroller

Interfacing 24×2 character lcd with Pic 16f877 microcontroller

Download project files. Folder contains code of interfacing 24×2 lcd with 8051(89c51,89c52) and pic 16f877 microcontroller. Simulation of the project is also in the folder. Simulation is made in proteaus 8.0. Plz give us your feed back on the post.

Watch the project Video here….

Post by Microcontroller Projects.

24×2 lcd with 8051(89c51) and pic 16f877 microcontroller


Filed Under: AVR, Electronic Projects, Microcontroller Projects, PIC Microcontroller

 

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: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

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!


RSS EDABOARD.com Discussions

  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • High Side current sensing
  • How to simulate power electronics converter in PSpice?
  • Voltage mode pushpull is a nonsense SMPS?
  • Layout IRN reduction in Comparator

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

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