Tuesday, November 22, 2011

§ Interfacing HD44780 LCD – Part1

Hello Friends,

            When we works around microcontroller then if we want to see readable output from our circuit then we commonly use LEDs (binary: yes/no) or Seven Segment Displays or LED Matrix displays etc. Here I am talking about most popular device for this purpose i.e. LCD Display. LCD stands for Liquid Crystal Display; it is widely used in the embedded world.

   When I got my first LCD in my hand then I am very excited to see my name on that screen. After spending lots of time with Google I found many data related to this like HD44780Datasheet, LCD instructions and commands, algorithms etc. I also found some readily available drivers for LCDs. After studying these data’s and going through some web pages i decided to design my own driver to control this LCD using AVR.

We can find LCD displays everywhere in our daily routine. They are found in mobiles, digital cameras, microwave, iPods etc. and now LCD TVs are also available.LCD Display comes in various shapes and sizes.





 
In this article I am focusing on most popular HITACHI 16X2 HD44780 monochromatic LCD display.16x2 means 2lines and 16 column.HITACHI is a Japanese company which designs those LCDs. This LCD has a built in microcontroller name HD44780 which communicate through LCD in certain manner and display many things. We have to interface this with our microcontroller. In the later section of this article i will share  that how you can interface it with 8-bit AVR microcontroller and display various things on it

 


 This is an alphanumeric display means we can display numbers, alphabets and symbols. The bitmap images of all the numbers, alphabets and symbols are previously stored in HD44780 ROM.

LCD Principle: 
inside the LCD screen liquid crystal is filled; these crystals have a property that when we apply voltage then crystal rotates and light falling on the screen is not reflected back from the screen’s backside wall hence we see black spot on screen.


LCD Pin out: 
It has 16 pins which include 3-control pins, 8-data pins, vcc-ground pins, contrast pin and LCD back light pins. Pin4,5 and 6 is control pins,pin7 to 14 are data pins.

 

LCD Control Pins :
Pin-4 RS-Register Select : the HD44780 has two 8-bit Registers - Instruction Register (IR) and Data Register(DR).IR stores instruction codes, such as display clear , go to home,display shift,cursor move etc.If we want to send command for LCD then we have to write this command in IR (RS=0 for Command write) and if we want to send data for display then we have to write that data on DR (RS=1 for data write).

Pin-5 RW-Read/Write : RW=1 for read fromLCD RW=0 for write to LCD.

Pin-6 EN-Enable : When it goes high(SET) it latches data or command.


 Hardware Connections :
There are two different ways to interface this LCD module: 8-bit mode and 4-bit mode.You can use either of them; here i am using 4-bit mode just for saving my controller pins.In 4-bit mode only MSB of data pins is used means pin DB4 to DB7. Because i don't need to read from LCD so i can connect pin-5 RW to ground directly. For LCD back-light connect a 470om register at pin-15.Pin-3 is used to control the contrast of LCD a 10k pot is used to control the contrast.See the image below.


In the next post i will show you - its internal operation ; write data and command.

                                                                                                                                           ~Pratyush


No comments:

Post a Comment

PID Controlled Self balancing Robot using ESP8266 and MPU6050

This ROBOT is made using ESP8266 Node MCU and MPU6050 accelerometer. Motor used here is normal gear motor of 150 rpm with TB6612FNG motor dr...