Tools & Downloads   /   Programmers & ICSP

How to display 5×8 and 5×10 size font characters on 16×2 lcd with 8-bit microcontrollers

Character lcds can display character of font size 5x8 and 5x10. In 5xn, 5 represents number of coulombs and N represents number of rows.

Published
Updated

At a glance

CategoryProgrammers & ICSP
IncludesCircuit diagram
Reading time~4 min
Jump to a section
  1. Standard Lcd Commands for 5x10 Display
  2. Displaying 5x10, 5x8 font size Characters on character lcd Using PIC16f877 Microcontroller
  3. Quick Solutions to Questions related to Displaying Font Sizes:
  4. Related projects

Summary of How to display 5×8 and 5×10 size font characters on 16×2 lcd with 8-bit microcontrollers

This article explains how to display 5x8 and 5x10 font characters on HD44780-based character LCDs using PIC16F877 and 8051 microcontrollers. It details initialization commands for font selection, memory limitations (208 chars in 5x8, 32 in 5x10), and custom character creation via CG-RAM. The project demonstrates displaying specific characters like G, J, P, and Q by addressing their locations in the controller's memory.

Parts used in the Displaying Font Sizes Project:

  • PIC 16f877 microcontroller
  • 16x2 lcd
  • Potentiometer
  • Crystal (20 MHz)
  • Capacitors 33Pf

Character lcds can display character of font size 5x8 and 5x10. In 5xn, 5 represents number of coulombs and N represents number of rows. Character lcd's especially which are controlled by Hitachi HD44780 controller can display 5x8 and 5x10 size font character. Some lcd's can only display character in 5x8 font. In this project i am going to teach you how to display characters of font size 5x8 and 5x10 on character lcd?
How to display 5x8 and 5x10 size font characters on 16x2 lcd with 8-bit microcontrollers
If you are newbie and don't know about internal structure of character lcd and how to interface it with microcontrollers? Than i suggest you you first take the getting started with lcd tutorial.

As you know first we have to initialize the lcd that we are using (8x1, 8x2, 8x4, 16x1, 16x2, 16x4, 20x1, 20x2, 20x4, 24x1, 24x2, 24x4, 32x1, 32x2, 40x1, 40x2, 40x4). By initialization I mean 

  • Should the cursor appears on lcd or not? If appearing, whether it should be blinking or normal?
  • What should be the size of character-font appearing on lcd (5x8, 5x10)?

To learn about lcd initialization standard commands go through the simple tutorial below. 

We are going to discuss only commands that are related to character size Font-matrix in this tutorial. To initialize character lcd we have to send commands to command-register of lcd. All the commands are 8-bit in nature. For Initializing character font size, 8-bit commands individual bits represents.

  • DL selects lcd mode. 8-bit or 4-bit. Don't know Go through the tutorial(Lcd in 4-bit and 8-bit mode)
  • N selects if lcd contains 2 rows or 1.
  • F selects character font size. (5x8 or 5x10)

Now if I have a 16x2 lcd and i want to initialize its Character font to be 5x10 my command will be.

Standard Lcd Commands for 5x10 Display

Now i am going to display characters on lcd in 5x8 and 5x10 font. I am going to print it on lcd using two different microcontrollers. Microchip pic16f877 and 8051(89c51,89c52) microcontroller. 

  • You can display 208 characters in 5x8 font and 32 characters in 5x10 font. Total ASCII characters present in HD44780 lcd controller are 240. In which 208 are in 5x8 font and 32 are in 5x10 font. 
  • In CG-RAM you can create 8 custom characters at a time in 5x8 font and 4 custom characters in 5x10 font. Don't know about CG-RAM and custom characters? Go through(CG-RAM & custom characters generation and display)

See the difference in the same characters in same row, marked against red and green star. red star represents 5x8 font size character and green represents same character with 5x10 size font. Picture taken from hd44780 controller data sheet.

Displaying 5x10, 5x8 font size Characters on character lcd Using PIC16f877 Microcontroller.

  Project Requirements

  • PIC 16f877 microcontroller
  • 16x2 lcd
  • Potentiometer (To set Lcd Contrast)
  • Crystal (20 MHz)
  • Capacitors 33Pf

I am going to print/display G,J,P & Q in 5x8 and 5x10 font. These characters are present in HD44780 Controller in 5x8 and 5x10 font. I will call their addresses and they will appear/display on lcd screen.
​How to display 5x8 and 5x10 size font characters on 16x2 lcd with 8-bit microcontrollers schematics
Lcd data pins are Connected to Port-B of microcontroller. Lcd control pins (en,rs,rw) are connected to Port-D Pins#7,6,5. Rest of the connections are normal connections. Supplying power to microcontroller. Grounding GND pin. Connecting Crystal to microcontroller etc. Circuit diagram of the project is given below.

Read more: How to display 5x8 and 5x10 size font characters on 16x2 lcd with 8-bit microcontrollers
  • What font sizes can Hitachi HD44780 controlled LCDs display?
    They can display 5x8 and 5x10 size fonts, though some units only support 5x8.
  • How many characters can be displayed in 5x8 and 5x10 fonts?
    You can display 208 characters in 5x8 font and 32 characters in 5x10 font.
  • Which bits in the 8-bit initialization command control the font size?
    The F bit selects the character font size between 5x8 or 5x10.
  • How many custom characters can be created in CG-RAM at a time?
    You can create 8 custom characters in 5x8 font or 4 custom characters in 5x10 font.
  • Can this project use both PIC and 8051 microcontrollers?
    Yes, characters can be displayed using either Microchip PIC16F877 or 8051 microcontrollers like 89C51 and 89C52.
  • What is the total number of ASCII characters available in the HD44780 controller?
    There are 240 total ASCII characters present in the HD44780 LCD controller.
  • Which pins on the PIC16F877 connect to the LCD data pins?
    LCD data pins are connected to Port-B of the microcontroller.
  • What is the purpose of the potentiometer in this circuit?
    The potentiometer is used to set the LCD contrast.
Programmers & ICSP

Calculator Test using PIC24FJ64GA006 with Proteus Simulation

Introduction The Calculator Test using EASYHDL is a practical microcontroller project built on the PIC24FJ64GA006 and simulated in Proteus. This project demonstrates...

Programmers & ICSP

PID Controlled Oven using TMS320F28027PT with Proteus Simulation

IntroductionThis project demonstrates a PID controlled oven implemented using a PICCOLO TMS320F28027PT microcontroller and verified through Proteus simulation.It is a practical microcontroller...

Programmers & ICSP

PICCOLO Motor Controller Sample Design using TMS320F28023PT with Proteus Simulation

IntroductionThis project demonstrates a PICCOLO motor controller sample design implemented using the TMS320F28023PT Piccolo microcontroller and tested through Proteus simulation. It focuses...

Programmers & ICSP · PIC16F84A

PIC Musical Doorbell using PIC16F84A with Proteus Simulation

IntroductionThis microcontroller project demonstrates a musical doorbell built around a PIC16F84A and a simple piezo sounder.Using two push buttons, the system allows...

Programmers & ICSP · PIC16F877A

EPE PIC/LCD Demo using PIC16F877 with Proteus Simulation

IntroductionThe EPE PIC/LCD Demo is a classic microcontroller project that demonstrates how a PIC16F877 can fully control a PG12864F graphical LCD.Designed as...

Programmers & ICSP · PIC16F628A

DHT11 Low Cost Humidity Sensor using PIC16F628A with Proteus Simulation

IntroductionThis microcontroller project demonstrates how to interface a low-cost DHT11 temperature and humidity sensor with a PIC16F628A using a Proteus simulation environment.The...

Ibrar Ayyub

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough...