Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • EE Design News
    • DIY Reviews
    • Guest Post
    • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering

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

February 12, 2021 By EG Projects

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

Related Articles Read More >

Remote Controlling Multiple Loads Using RF Module (Part 2/23)
Increasing Range of RF Module by Increasing Transmission Power (Part 3/23)
Increasing range of RF module by using antenna (Part 4/23)
Increasing the Range of RF Module by Using Antenna and Increasing Transmission Power (Part 5/23)

Featured Tutorials

  • Remote Controlling Multiple Loads Using RF Module (Part 2/23)
  • Increasing Range of RF Module by Increasing Transmission Power (Part 3/23)
  • Increasing range of RF module by using antenna (Part 4/23)
  • Increasing the Range of RF Module by Using Antenna and Increasing Transmission Power (Part 5/23)
  • Controlling Multiple RF Receivers by Universal RF Transmitter (Part 6/23)
  • Multiple RF Receivers Controlled by a Universal RF transmitter based on Address Pin Configuration (Part 7/23)

Stay Up To Date

Newsletter Signup

EE Training Center Classrooms

“ee

“ee

“ee

“ee

“ee

Recent Articles

  • IAR Systems announces IEC and ISO certifications of its RISC-V development tools
  • Mathematical equations executed by an MCU
  • Infineon’s new Wi-Fi 6 brings reliable connectivity to smart homes
  • Toshiba releases compact LDO regulators for stabilizing DC power lines
  • Clap sensor using STM32 MCU
...

RSS EDABOARD.com Discussions

  • How can I explan this simple PWM creator Circuit
  • Can I use a Virtual clock instead of using a create_clock?
  • MCLR as digital input is resetting the device
  • Symmetrical Fully Differential Amplifier Layout
  • What is the DC voltage rating of this Y2 capacitor?

RSS Electro-Tech-Online.com Discussions

  • NTC flakey
  • Diode that only allows continuity at 13.5v?
  • Can two N-Channel MOSFETs be connected in series to perform a "AND" function?
  • Cycle Indicator Lights
  • #MEASURING OUTPUT VOLTAGE# Ideal laboratory power supply - YOURS requirements
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2021 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 | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Circuit Design
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • EE Design News
    • DIY Reviews
    • Guest Post
    • Sponsored Content
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key 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
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • Video
    • White Papers
    • Webinars
  • EE Learning Center
  • Women in Engineering