- Basic unit of display is pixel.
- PIXEL= picture + element.
- Above figure shows that each LCD have its own pixel rows and columns like 1×16 has single raw and sixteen columns i.e. 16 pixel and each pixel size is of 5×8 as shown but we can see only 5×7 cause last raw is used by cursor.
- Each character is display according to these pixels size.
- Below pic shows block diagram of 16×2 LCD.
- Rs -> Register select
Rs=1 mean data register is selected.
Rs=0 mean command register is selected.
- RW -> Read/Write
RW=1 mean reading from LCD module.
RW=0 mean writing to LCD module.
- EN -> Enable
EN= high to low ( Logic ‘1’ delay Logic ‘0’ ) for use LCD module .
-
How characters are generate on LCD screen?
- There are three memories in LCD to manipulate display characters:
- CGROM – character generating ROM which is responsible for stored standard character pattern.
- CGRAM – character generating RAM which holds custom character pattern space ( total 8 in 2×16 module).
- DDRAM – data display RAM which stores ASCII codes.
- Steps to understand how character display:
- Control unit of LCD receives signal(basically it is ASCII code) from user and ask to DDRAM for its match.
- If ASCII code match, control unit maps corresponding character pattern from CGROM.
- According to that character pattern, LCD screen energies and we can see character on it .
- 16×2 lcd commands
Code (Hex) |
working of lcd commands |
1 |
Clear display screen |
2 |
Return home |
4 |
Decrement cursor (shift cursor to left) |
6 |
Increment cursor (shift cursor to right) |
5 |
Shift display right |
7 |
Shift display left |
8 |
Display off, cursor off |
A |
Display off, cursor on |
C |
Display on, cursor off |
E |
Display on, cursor blinking |
F |
Display on, cursor blinking |
10 |
Shift cursor position to left |
14 |
Shift cursor position to right |
18 |
Shift the entire display to the left |
1C |
Shift the entire display to the right |
80 |
Force cursor to beginning to 1st line |
C0 |
Force cursor to beginning to 2nd line |
90 |
Force cursor to beginning to 3rd line |
D0 |
Force cursor to beginning to 4th line |
38 |
2 lines and 5×7 matrix (8-bit mode) |
28 |
2 lines and 5×7 matrix (4-bit mode) |
n |
Next line |
t |
Tab |
r |
enter |