Engineers Garage

  • Electronics Projects and 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

GLCD 128×64 graphical lcd(GLCD) interfacing with 8051(89c51,89c52) microcontroller

By EG Projects February 10, 2021

In this tutorial i am going to teach you how to interface graphical lcd 128×64 with 8051(89c51,89c52)microcontroller. 128×64 means that lcd has 128 coulombs and 64 rows. Which means you can make your desired image or text in 128×64 matrix square. Graphical lcds comes in many sizes, they also differ in characteristics. Some can be directly connected to your PC and you just need to learn simple commands to send pictures and text to lcd, these graphical lcds comes with free software with them. Some are just simple lcds and you need to control them with some intelligent unit like microcontroller etc. In this tutorial we are going to control the same simple graphical lcd using 89c51 microcontroller. We will display text on graphical lcd using 8051 microcontroller. 

How graphical lcds work?

I am going to interface jhd12864e graphical lcd with 8051 microcontroller. To learn about full pin description and internal organization of pixels of jhd12864e graphical lcd please go through the simple tutorial. This will lead you to easily understand the code written below.

  • 128×62 Graphical lcd Pin out and Description

The above tutorial is very important to understand the GLCD code below. If yon don’t know about the GLCD working then you can not understand the 8051 microcontroller with GLCD code below. Pin out of GLCD jhd12864e is given below.

JHD128x64 graphical lcd pin out

JHD128x64 graphical lcd pin out

JHD12864e GLCD with 8051 microcontroller

I am going to print my website name “microcontroller-project.com” on glcd. First i decided text font to display on GLCD. II finalized the character height to 8 rows and 5 to 6 coulombs in width. You can display text according to your desire. Since you have lot of available space from 128 coulombs to 64 rows. Combine pages to make font greater and greater(If you don’t know what is page in graphical lcd please go through the upper tutorial).

Steps to display text on GLCD

  • Initialize the jhd12864e glcd(Display on-off,set x,y address,set start line)  
  • Select the graphical lcd half(left or right)                      Don’t understand! Take the Upper tutorial.
  • Select the page                                                             Don’t understand! Take the Upper tutorial.
  • Make and display text                                                   Don’t understand! Take the Upper tutorial.

How text is made and displayed on GLCD?

Now when you are done with initializing glcd and selected glcd half and page. Its time to make/display text or image on glcd. Each page of GLCD is organized in rows and coulombs (8×64 in dimension) 8 rows and 64 coulombs. Each coulomb in a page has 8 dots aligned vertically. We send an eight bit data to make these dots ON or OFF. 0 is OFF and 1 is ON. A simple command like FF=11111111 makes all dots of coulomb ON & F0=11110000 makes first four dots OFF and last four ON. You make your desired text or image by making these pixels ON or OFF. The combination of all coulombs makes a picture. 

For example to display the ‘M‘ character on Glcd the data send to GLCD is below. Data is send to glcd 8-bit at a time. 8-bit data is in hexadecimal format. If we translate hexadecimal to binary it will represent the below character. Last command is not displaying any thing. Its actually the gap for another character to appear a head of ‘M‘.

Making and displaying character on page of GLCD

Making and displaying character on page of GLCD

JHD12864e interfacing with 8051 microcontroller – Project circuit diagram

Circuit diagram of the project is simple. Connect Port-1 of 8051(89c51,89c52) microcontroller with data pins of graphical lcd. Port-3 pin 0 is connected to rs(register select) pin of graphical lcd. Port-3 pin 1 is connected to rw(read-write pin of graphical lcd). Port-3 pin 2 is connected to en(enable) pin of lcd. Port-3 pin 3 and 4 are connected to cs1(chip select 1) and cs2(chip select 2) to 128×64 graphical lcd. Port-3 pin 5 is connected to reset pin of 128×64 graphical lcd. Rest of the connections are for 8051 microcontroller initialization. Circuit diagram of the project is below.

Graphical lcd with 8051(89c51,89c52)

Graphical lcd with 8051(89c51,89c52) circuit diagram

GLCD interface with 89c51 microcontroller code

Coming to code of GLCD project. it is written in c language using keil uvision 3 software to compile and create hex code. First the header file reg51.h is included(it is to be included in every project made in keil for 8051 microcontroller). Then single bits of Port-3 are defined. These pins are used to control jhd12864e graphical lcd. delay() function is generating some delay for us to be used where necessary. lcdcmd() function is sending commands to glcd. lcddata() function is sending data to glcd. The main function is controlling all the displaying and control functions. Each command is commended with its function.

While(1) loop at the end only runs the code once. Website name “microcontroller-project.com” will be displayed on two pages of jhd12864e.  

Note: Some graphical lcds select cs1, cs2(chip select) on 1 and some with 0. If you are using this code be sure that 0 selects your cs1 & cs2. If not 0 then switch cs1 & cs2 in the code just make cs1=1 where it is 0 and cs2=0 where it is 1.

Some more microcontroller projects involving jhd12864e graphical lcd are below. Images are also displayed on GLCD using variety of microcontrollers.

  • Graphical Lcd JHD12864E with Pic Microcontroller
  • Displaying Images On Graphical Lcd 128×64
Download the project files. Folder includes project code(Hex,c++) and simulation. Code is written in c language and keil uvision 3 is used to compile code. Simulation is made in proteus 8. If you have any quextions plz write them below.
                                                                                                                                                                                     Graphical lcd with 8051 files/code

You may also like:


  • What are EMS/EMC immunity lab tests?

  • What are the top development boards for AI and ML?

  • Sensor value display on TFT LCD using Arduino: Part I

  • What drone parts you need to build a quadcopter?

  • What’s a protective relay and what does it protect?

  • What is MicroPython?

Filed Under: 8051 Microcontroller, Electronic Projects, Featured Contributions, 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: 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

  • Battery sensing circuitry for coin cell application
  • I/O constraint for Hold check
  • Question LCD LED IPS display
  • How can I get the frequency please help!
  • Fuel Gauge IC for Primary Cell Monitoring

RSS Electro-Tech-Online.com Discussions

  • how to work on pcbs that are thick
  • 100uF bypass Caps?
  • Fuel Auto Shutoff
  • Actin group needed for effective PCB software tutorials
  • compatible eth ports for laptop

Featured – Designing of Audio Amplifiers part 9 series

  • Basics of Audio Amplifier – 1/9
  • Designing 250 Milli Watt Audio Power Amplifier – 2/9
  • Designing 1 Watt Audio Power Amplifier – 3/9
  • Designing a Bass Boost Amplifier – 4/9
  • Designing a 6 Watt Car Audio Amplifier – 5/9
  • Design a low power amplifier for headphones- 6/9

Recent Articles

  • ITG Electronics releases gate drive transformers with 200 – 450 V DC capability
  • Stackpole introduces HCJ jumpers with 70.7 amp continuous current capability
  • Infineon releases MCU with 128K flash and multi-sense capabilities
  • ST introduces 600V GaN gate drivers with 300 ns start-up time
  • ABLIC releases S-19116 automotive voltage detector with 6.8μs response time

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

  • Electronics Projects and 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