Lcd tutorial for interfacing with microcontrollers basics of alphanumeric lcd rickey's world of microcontrollers & microprocessors
1. Rickey's World (http://www.8051projects.net/) Register (../signup.php) Login (/login.php)
Index (index.php)
Introduction to Alphanumeric LCD (introduction.php)
Basics of LCD (basics.php)
LCD Commands (commands.php)
LCD 8-bit Initialization (initialization.php)
Checking Busy Flag of LCD (busyflag.php)
Sending command & data to LCD (lcd-programming.php)
Creating custom character and patters (lcd-custom-character.php)
LCD in 4-bit Mode - Introduction (lcd-4-bit.php)
LCD in 4-bit Mode - Programming (lcd-4-bit-programming.php)
DDRAM - Display Data RAM
Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its extended capacity is 80 X 8 bits, or 80 characters. The area in
display data RAM (DDRAM) that is not used for display can be used as general data RAM. So whatever you send on the DDRAM is actually displayed on
the LCD. For LCDs like 1x16, only 16 characters are visible, so whatever you write after 16 chars is written in DDRAM but is not visible to the user.
Figures below will show you the DDRAM addresses of 1 Line, 2 Line and 4 Line LCDs.
Figure 2: DDRAM Address for 1 Line LCD
Figure 3: DDRAM Address for 2 Line LCD
Figure 4: DDRAM Address for 4 Line LCD
CGROM - Character Generator ROM
Now you might be thinking that when you send an ascii value to DDRAM, how the character is displayed on LCD? so the answer is CGROM. The
character generator ROM generates 5 x 8 dot or 5 x 10 dot character patterns from 8-bit character codes (see Figure 5 and Figure 6 for more details). It
can generate 208 5 x 8 dot character patterns and 32 5 x 10 dot character patterns. Userdefined character patterns are also available by mask-
programmed ROM.
(http://www.facebook.com/sharer.php?
u=http://www.8051projects.net&t=Rickey%27s+World+of+Microcontrollers)
(https://twitter.com/intent/tweet?
text=Rickey%27s+World+of+Microcontrollers&url=http://www.8051projects.net)
(https://plus.google.com/share?
url=http://www.8051projects.net)
Home
(http://www.8051projects.net/) News
(http://www.8051projects.net/news.php) Discussion Forum
(../plugins/forum/forum.php) Tutorials
(http://www.8051projects.net/microcontroller-
tutorials/)
Downloads
(http://www.8051projects.net/download.html) LCD Pinouts
(http://www.8051projects.net/lcdpinouts.html) Jet Engine
(http://www.8051projects.net/jetengine/) Games
(http://www.8051projects.net/arcade.html) More
Home (http://www.8051projects.net/) Tutorials (/microcontroller-tutorials/) LCD Interfacing tutorial (/lcd-interfacing/) Search ...
LCD Interfacing Tutorial: Basics of Alphanumeric LCD
LCDs, Character, Graphic
www.us-electronics.com
Liquid Character Displays,inverters High quality, lowest prices on line
Table of Content
2. Figure 5: LCD characters code map for 5x8 dots
Figure 6: LCD characters code map for 5x10 dots
As you can see in both the code maps, the character code from 0x00 to 0x07 is occupied by the CGRAM characters or the user defined characters. If user
want to display the fourth custom character then the code to display it is 0x03 i.e. when user send 0x03 code to the LCD DDRAM then the fourth user
created charater or patteren will be displayed on the LCD.
CGRAM - Character Generator RAM
As clear from the name, CGRAM area is used to create custom characters in LCD. In the character generator RAM, the user can rewrite character
patterns by program. For 5 x 8 dots, eight character patterns can be written, and for 5 x 10 dots, four character patterns can be written. Later in this
tutorial i will explain how to use CGRAM area to make custom character and also making animations to give nice effects to your application.
BF - Busy Flag
Busy Flag is an status indicator flag for LCD. When we send a command or data to the LCD for processing, this flag is set (i.e BF =1) and as soon as the
instruction is executed successfully this flag is cleared (BF = 0). This is helpful in producing and exact ammount of delay. for the LCD processing.
To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy
3. and will not accept next command or data and BF = 0 means LCD is ready for the next command or data to process.
Instruction Register (IR) and Data Register (DR)
There are two 8-bit registers in HD44780 controller Instruction and Data register. Instruction register corresponds to the register where you send
commands to LCD e.g LCD shift command, LCD clear, LCD address etc. and Data register is used for storing data which is to be displayed on LCD. when
send the enable signal of the LCD is asserted, the data on the pins is latched in to the data register and data is then moved automatically to the DDRAM
and hence is displayed on the LCD.
Data Register is not only used for sending data to DDRAM but also for CGRAM, the address where you want to send the data, is decided by the
instruction you send to LCD. We will discuss more on LCD instuction set further in this tutorial.
← Previous Page (introduction.php) Index (index.php) 1 (introduction.php) 2 (basics.php) 3 (commands.php) 4 (initialization.php)
5 (busyflag.php) 6 (lcd-programming.php) 7 (lcd-custom-character.php) 8 (lcd-4-bit.php) 9 (lcd-4-bit-programming.php)
Next Page → (commands.php)
Share it! Like it!
1 41 0 2Google + 1 1711 16