4. Liquid Crystal Display(LCD)
LCD Interfacing:
The LCD has the ability to display (Numbers, Characters and
graphics) so they are widely used in AVR real word applications.
LCD Description:
The following table shows the pin description of the LCD
Eng:Mohamed Loay Ali
4
5. Liquid Crystal Display(LCD)
RS (Register Select):
When RS=0, this allow the user to send command such as (clear
screen, go home, blink cursor).
When RS=1, this allow the user to send data.
Enable:
It used to latch the information to the data pins, this done by send a
high to low pulse (of width of 450 ns) so the LCD latches the data
presented on the data pins.
Eng:Mohamed Loay Ali
5
7. Liquid Crystal Display(LCD)
Sending Commands and data to the LCD:
The following steps should be done to send the
command and data to the LCD:
1) Initialized the LCD.
2) Sending Commands to the LCD.
3) Sending data to the LCD.
Eng:Mohamed Loay Ali
7
8. Liquid Crystal Display(LCD)
1)Initialized the LCD :
For example to initialize LCD [2 lines 5*7 matrix 8bit mode]
the following commands should be used:
1. 0x38 to select the type and mode of operation
2. 0x0E to display the cursor blinking.
3. 0x01 to clear the LCD display.
Note: After powering up the LCD a 15 ms should be waited
to send the commands.
Eng:Mohamed Loay Ali
8
9. Liquid Crystal Display(LCD)
2)Sending Commands to the LCD :
To send commands to the LCD the following steps should be done:
1. RS=0, RW=0.
2. The command number should be put on the data pins (D0 to
D7).
3. A pulse (high to low) should be sent on the Enable pin.
After each command a delay of (100us) should be placed.
Eng:Mohamed Loay Ali
9
10. Liquid Crystal Display(LCD)
3) Sending data to the LCD :
To send data to the LCD the following steps should be done:
RS=1, RW=0.
1. The data should be put on the data pins (D0 to D7).
2. A pulse (high to low) should be sent on the Enable pin.
After each data a delay of (100us) should be placed.
Eng:Mohamed Loay Ali
10
12. Liquid Crystal Display(LCD)
Typical Connection of LCD(4bit mode) :
Remember that there are a special pins on the AVR for example (ADC
pins, Interrupt pins, Communication pins).
If one of those purposes is required in the application try to not connect
the LCD with those special pins required for the application.
See 4bit and 8bit examples of LCD.
Eng:Mohamed Loay Ali
12