Creating Pac man custom patterns and animation in LCD display

LCD modules are widely used to display calculated data’s, user references and much more. In addition all character based LCD which uses HD44780 controller consists of a special RAM known as CGRAM which allows user to create custom patterns. This tutorial will teach you to create your desired pattern as well running it as a simple animation

Creating Pac man custom patterns and animation in LCD display

CGROM:

CG ROM is nothing but a memory which holds the pattern of the characters as predefined lcd font. Ever wondered how LCD displays the corresponding font when you pass the ASCII value of a particular character. This job was done by means of this CGROM memory.

DDRAM:

This memory holds the characters which are currently displayed on the screen. That is whenever a character is about to displayed the contents of the CGROM will be loaded to the DDRAM and in this way the characters can be displayed in the screen.

CGRAM:

CGRAM is the memory in the LCD module which allows user to create custom characters by rewriting the character patterns in the program.Generally we will initialize the LCD by using “0x80” command which will point the DDRAM address and from there the LCD allows us to display predefined  characters which is stored in the CGROM.
In order to create custom pattern we should initialize the device to point the CGRAM address ranging from 0x00 to 0x07 in the LCD. This can be done by using the command “0x40”, which forces the device to point CGRAM address. Refer the instruction set of LCD for better understanding. Remember there is a difference between instruction “0x40” and address “0x00” try not to get confused.
So whenever you writes the instruction 0x40 it will allow us to create the predefined character in the CGRAM address 0x00. The command 0x48 will allows us to store the pattern in the address 0x01. In this way we can create up to 8 character patterns. So we now know what is CGRAM and how to initialize it for storing our custom character. Now lets see how to create the pattern in it.

 


About The Author

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 research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top