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

Making and displaying Custom Characters on 16×2 lcd using 8051(89c51,89c52) Microcontroller

By EG Projects February 12, 2021

This tutorial is about making and displaying custom characters on 16×2 lcd using 8051(89c51,89c52) microcontroller. By custom i mean characters that are not alphabets, digits or ASCII value characters. Rather they are new and designed by us. I first recommend you to please go through the following simple tutorial. This will clear you about the internal structure of character lcd’s its registers, memory and controller used for controlling the displayed characters (HD4478). But if you only require project code than proceed further.

  • How to display custom characters on character lcd. 
  • How NXN lcd works

Custom fonts display on 16x2 lcd

Custom fonts display on 16×2 lcd with 89c51 microcontroller
After reading the tutorial you will be able to understand the tutorial/project code written below and you will also be familiar with the character generated(CG-RAM) RAM of 16×2 lcd. Custom characters are made in the CG-RAM of 16×2 character lcd and then invoked by controller for displaying on the 16×2 lcd. CG stands for “Character Generated” RAM (Read only memory). I used Hitachi 16×2 lcd in the project you can use any other. But be sure to change few initializing commands of the code if you are using lcd of any other size other than 16×2 (Read the datasheet-Commands for initializing of lcd with size other than 16×2).

Custom characters on 16×2 lcd Circuit diagram

Circuit of the project is also simple. Port-3 pins 5 and 6 are used as rs(register set) and en(enable) pins for lcd don’t know what is it just click the link you will have a good tutorial on it (How NXN lcd works). Port-1 is of 8051 microcontroller is connected to data pins of 16×2 lcd. 11.0592Mhz external crystal is used to supply clock to the microcontroller. 

Custom characters displayed on 16x2 lcd with 89c51 microcontroller circuit diagram

Custom characters displayed on 16×2 lcd with 89c51 microcontroller circuit diagram

Custom character generation with 8051 microcontroller project code

I am using keil ide for writing and compiling code. In the code first of all I included the predefined header file reg51.h .This library is necessary to be included when ever you are writing code for 8051(89c51) series microcontrollers in keil ide. Absence of it can cause a problem for you most commonly the compiler will not compile your file.
​
I defined the required Custom characters in the form of Character arrays which are used later for generating characters. Port-1 of 89c51 microcontroller is used to send data and commands to lcd. The rest of the code is simple the delay function is their for generating some arbitrary delay. The lcdint() function is initializing the lcd. In my main function i am generating the custom characters and then printing them on 16×2 lcd. The main function is in while(1) continuous loop. Due to this while(1) continuous loop characters are continuously displaying on the character 16×2 lcd screen.
At a time you can make only 8 characters in CG-RAM. I also made only 8 custom characters but their is a simple method to generate more. The method is first create 8 characters and then display them on lcd. Now again make 8 characters. Making new characters will replace the previous from CG-RAM. Actually the CG-RAM is overwritten by new characters, So by applying this simple technique you can make as many characters as you need. If you have any questions regarding the post or you are unable to understand the code please leave your comments below.
Download the project files and code(C++,HEX). Code is written in c language. keil uvision 4 is used for generating hex code and for compiling code. The download folder contains all the project files.
Custom Character on lcd with 89c51 Microcontroller

You may also like:


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

  • What are top applications of CAN protocol?

  • What drone parts you need to build a quadcopter?
  • battery selection low power design
    What are the battery-selection criteria for low-power design?

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

  • What is an Actuator Sensor Interface (AS-i)?

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

  • GanFet power switch starts burning after 20 sec
  • RF-DC rectifier impedance matching
  • Inverting OpAmp - basic circuit question
  • 12VAC to 12VDC 5A on 250ft 12AWG
  • Precision CAD Drafting Services for Architectural & Engineering Projects

RSS Electro-Tech-Online.com Discussions

  • LED circuit for 1/6 scale diorama
  • stud mount Schottky diodes
  • Hi Guys
  • using a RTC in SF basic
  • Can I use this charger in every country?

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

  • Fischer connector system adds ratchet locking system designed for 300g shock resistance
  • Littelfuse introduces tactile switch with enhanced bracket peg design for mounting strength
  • Infineon releases GaN switch with monolithic bidirectional design
  • Sienna Semiconductor data converters feature sample rates from 20 to 250 Msps
  • Delta’s 5,500 W power supplies achieve 97.5% energy efficiency for AI servers

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