Custom Character Display Using LPC2148

In this tutorial we are going to see how to generate LCD Custom Character (Custom Character Display Using LPC2148).

Prerequisites

Before start this tutorial we should know below topics. If you know already, please go further.

How to generate LCD Custom Character using LPC2148

Introduction

So we know how to display alphanumeric characters in LCD. We can easily display that. Because it is already stored in the ROM memory of LCD. Before that we should know the memories of LCD. There are three types of memory present in the LCD display.

  1. CG ROM
  2. DD RAM
  3. CG RAM

CG ROM (Character Generator ROM) 

This memory holds the pattern for every single character of  predefined LCD font. and you call the content of this memory by the placing  corresponding ASCII value on the LCD port . For example if you want to display  ‘A’ you have to send the ASCII value of ‘A’ which is 0x41 to the LCD.   So we cannot modify its contents which is stored already.

DD RAM  (Display Data RAM)

DDRAM is the memory which holds only those characters which are currently on the screen . means if there is a message is currently being displayed on the screen then it has to be  on the DDRAM. For example if you want to display “hello” on the screen then you have to load pattern of h from the CG ROM to DD RAM then do the same for ‘e’ ,’l’ ,’l’ and ‘o’.

This is the address of the DDRAM memory in 16×2 LCD

Position1234.....16
Row1 0x800X810X820X83......0X8F
Row20xC00XC10XC20XC3......0XCF

This memory works same as CG ROM but as this is RAM we can modify it’s content any time. So this is the place where we can store our custom character pattern. Then that pattern can be sent to display.

CG RAM (Character generator RAM)

For making custom patterns we need to write values to the CGRAM area defining which pixel to glow. These values are to be written in the CGRAM address starting from 0x40. Bit 7 is 0 and Bit 6 is 1, due to which the CGRAM address command starts from 0x40, where the address of CGRAM (Acg) starts from 0x00. CGRAM has a total of 64 Bytes. When you are using LCD as 5×8 dots in function set then you can define a total of 8 user defined patterns (1 Byte for each row and 8 rows for each pattern), where as when LCD is working in 5×10 dots, you can define 4 user defined patterns.

Custom Character Display Using LPC2148

Connection

LCD

  • RS – P0.8
  • RW – P0.9
  • EN – P0.10
  • Data Lines – P0.0 – P0.7

Source Code

This code will print the custom character in Tamil language. Tamil language is not in the LCD. So that i’m going to create the few characters from Tamil. You can also try in your language or any custom character you want. See the code attached below.

Output

Custom Character Display Using LPC2148[ Please find the output image Here ]

0 0 vote
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x
%d bloggers like this: