Displaying Hindi Alphabets on LCD Using 8051
Displaying Hindi Alphabets (or alphabets of any language) and custom characters on a 16 x 2 LCD Display can be done easily even without knowing their ASCII values. There are many types of LCD displays and one of the most commonly used type is the 16 x 2 Alphanumeric Character LCD Display.
Conventionally, English alphabets, numbers, some mathematical symbols and few predefined symbols can be easily displayed on a 16 x 2 LCD Display. In this project, we will program the 8051 microcontroller to display few Hindi alphabets and some special symbols on a 16 x 2 LCD Display Module.
- AT89S52 Microcontroller (any 8051 Architecture based Microcontroller would be fine)
- 8051 Microcontroller Development Board
- 16 x 2 LCD Display
- 10 KΩ Potentiometer
- Connecting Wires
- Power Supply
- Mini Breadboard
Since the project is about displaying Hindi alphabets and custom characters on an LCD display, the design of the circuit is very simple and involves only a Microcontroller and a 16 x 2 Alphanumeric LCD Display.
We have used a simple 8051 Development board in this project and hence, all the important connections like crystal, reset and power supply etc. are already taken care of. In case you do not have a development board, the circuit diagram shows all the necessary connections.
Coming to the design of the circuit, connect the 8 data pins of the LCD i.e. D0 to D7 to PORT 1 pins. RS, RW and E are the control pins of the LCD. They must be connected as follows: RS to P3.6, RW to GND and E to P3.7.
Pins 1, 2, 15 and 16 are power pins of the LCD Module. Connect Pins 1 and 16 of LCD to GND and Pins 2 and 15 to VCC. Finally, connect the Pin 3 i.e. the Contrast adjust pin of LCD to a 10 KΩ Potentiometer.
16 x 2 LCD Display
A 16 x 2 LCD Display module is a very basic type of LCD Displays that is very common among electronics students and hobbyist circuit makers. Even some of the major applications like Thermostats, weather monitoring systems etc. use this basic LCD display. A 16 x 2 LCD can display in 2 row with up to 16 characters in each row.
Image 16 x 2 LCD Display
Character LCDs are different from Graphical LCDs as character LCDs are limited to display English texts, numbers and few symbols. Graphical LCDs can also display texts but they are best used for displaying images.
Working of the Project
A simple project in which custom Hindi Alphabets and some special characters are displayed on a 16 x 2 LCD display module with the help of 8051 Microcontroller. Hardware point of view of the project, there is nothing special as all we need to do is connect the components as per the circuit diagram.
The part that involves in displaying Hindi alphabets is the programming. Hence, the working of the project is explained in terms of programming of the microcontroller.
Displaying custom characters like Hindi Alphabets for example is very easy and requires a little knowledge about the internal memory of 16 x 2 LCD Display and also the controller associated with the display i.e. Hitachi’s HD4478. For detailed information, it is suggested to refer the controller’s data sheet.
First, let us see about the two types of RAM involved in displaying texts. They are CG RAM (Character Generator RAM) and DD RAM (Display Data RAM). The default characters like A, a, B, b, etc. are stored in the CG ROM. In order to display custom characters, we need to use the CG RAM. In a 5 x 8 Pixel LCD Display, the CG RAM can be loaded up to 8 new characters or symbols.
To write the first character, the address for CG RAM is 0x40 and increases subsequently as 0x48 for second character and so on. So, if we want to write a custom character, the address location must be 0x40 and for the further characters, the address automatically increases.
Now, to generate characters, we need to configure the pixel dots of the LCD. For this, we can use any LCD character generator application. The application shown below gives a nice user interface where the user can select the individual pixels for a character and generates the corresponding Hexadecimal code.
A sample character ‘number 0’ is designed and the hex values are generated.
For number ‘0’, the hex values are as follows: 0x0E, 0x11, 0x13, 0x15, 0x19, 0x11, 0x0E, 0x00. The following image shows how we got these values. It is just the hexadecimal representation of the individual rows.
The following image shows the hexadecimal values for the Hindi Alphabet ‘क’. In order to display this character on the LCD first we need to set the CG RAM Address as 0x40 by using this command “cmd (0x40);”
After this, we need to send the corresponding 8 bytes of data for the alphabet ‘क’ i.e. 0x1F, 0x04, 0x0C, 0x17, 0x0D, 0x05, 0x05, 0x04.
Until now, we have just loaded the CG RAM with the character information. In order to display the character, we need to call a simple display (0) function.
After the first character is displayed, we need not increment the RAM Address as it automatically gets incremented. Also, to display the further characters, the function display (1), display (2), etc. must be used.
Advantages and Disadvantages
Advantage: This project allows us to display alphabets of different languages without the knowledge of their ASCII values.
Also, several special characters can be easily displayed with the help of simple programming.
Disadvantage: Since the pixels per character is very less (40 pixels per character), displaying complex alphabets with high accuracy might not be possible.
- Displaying Hindi alphabets on 16 x 2 LCD allows us to convey messages in Hindi Language.
- Special symbols and custom characters can be easily displayed on 16 x 2 LCD display and used in applications like battery charging information, directions, temperature or other weather related data etc.