In this post i am going to explain how to interface 24×2 lcd with microcontroller. I am going to interface lcd with 8051(89c51,89c52) and Microchip Pic16f877 microcontrollers. 24×2 means 24-Coulombs and 2-Rows. Total characters which we can display on 24×2 lcd (24×2=48) 48. 24 Characters on each row. Interfacing 24×2 lcd with microcontroller is same as we interface other character lcds with microcontrollers. 24×2 lcds are controlled by hd44780 controller, the same controller used to control 8×1,16×2,20×2 lcds. Commands to initialize 24×2 lcd are same used to initialize other character lcds. Registers of lcd are also same. Data read and write process is also same.
About LcdLcd which i am using is from Samsung. Its number is unknown. Only a number UC24202, GNAR4PA, 010429, is written on its back. Also it is mentioned “Made in China” đ I found this lcd on an old control system panel. Control panel is out of use so i removed this lcd from the panel and used it in my diy project. I could not found the lcd pin out on internet. I managed to locate the pin names by mapping the header with standard character lcd’s .
|
Interfacing 24×2 lcd with 8051(89c51,89c52) microcontroller
Interfacing 24×2 lcd with 8051(89c51,89c52) microcontroller is an easy task. If you already interfaced any character lcd with 8051(89c51,89c52) microcontroller you can easily interface 24×2. But if you don’t then below are some small tutorials on lcds which will help you in understanding how to interafce and display characters on character lcd’s.
I am going to display ‘ABC’ Alphabets on lcd. First Row of lcd will display Upper case Characters and on second row lower case alphabets will be displayed, up to ‘X’. Displaying text on lcd is not a hard task. Tutorial How to display text on character lcd is very helpful resource in order to carry out this task. I recommend you to please take the tutorial(Link given above the paragraph).
Lcd data pins are connected to Port-1 of 89c51 microcontroller. Lcd controlling pins en(Enable) is connected to Port-3 pin#7, rw(Read/Write) is connected to Port-3 Pin#6 and rs(Register select) is connected to Port-3 Pin#5. delay function is used to generate some arbitrary delay. In main function a and b variables are initially initialized with ‘A’ and ‘a’, and are incremented one by one to display whole ‘AbC’ alphabets on lcd.
Interfacing 24×2 lcd with Microchip Pic16f877 Microcontroller
Interfacing 24×2 lcd with pic16f877 microcontroller is same like interfacing it with 8051(89c51). The only difference is in the ports. 8051 has Ports-1,2,3&4, where as pic has Ports-A,B,C,D & E. I am interfacing lcd in 8-bit mode with pic 16f877. Port-B of Pic16f877 is connected to data pins of lcd. Lcd controlling pins en(enable) is connected to Port-D Pin#7,Rs(Register select) is connected to Port-D pin#6, Rw(Read-Write) is connected to Port-D Pin#5. Circuit diagram of the project is given below.
Code is also same like 8051(89c51). The difference is in libraries 89c51 is programmed using keil Compiler, where as pic is programmed using high tech c compiler. Both compilers need different libraries to compile the code. Main function code is also similar to the 89c51 microcontroller main function code.
Download project files. Folder contains code of interfacing 24×2 lcd with 8051(89c51,89c52) and pic 16f877 microcontroller. Simulation of the project is also in the folder. Simulation is made in proteaus 8.0. Plz give us your feed back on the post.
Watch the project Video here….
Filed Under: AVR, Electronic Projects, Microcontroller Projects, PIC Microcontroller
Questions related to this article?
đAsk and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.