LCD interfacing with Microcontroller 8051
LCD overview :-
We probably use items containing an LCD (liquid crystal display) every day. They are all around us -- in laptop computers, digital clocks and watches, microwave ovens, CD players and many other electronic devices. LCDs are common because they offer some real advantages over other display technologies. They are thinner and lighter and draw much less power than cathode ray tubes (CRTs),
Common-plane-based LCDs are good for simple displays that need to show the same information over and over again. Watches and microwave timers fall into this category. Although the hexagonal bar shape illustrated previously is the most common form of electrode arrangement in such devices, almost any shape is possible. Just take a look at some inexpensive handheld games: Playing cards, aliens, fish and slot machines are just some of the electrode shapes you'll see.
The HD44780 dot-matrix liquid crystal display controller and driver LSI displays alphanumeric characters and symbols. It can be configured to drive a dot-matrix liquid crystal display when interfaced with a processor. A single HD44780 can display up to one 8-character line or two 8-character lines.HD44780 supports 8 dot character fonts and 32 5 ´ 10 dot character fonts for a total of 240 different character fonts.
3.1 Function Description
The following section will introduce the user with some of the important features of the liquid crystal display, that are important for interfacing with the liquid crystal display through software.
3.1.1 Registers
The HD44780 has two 8-bit registers, an instruction register (IR) and a data register (DR).The IR stores instruction information, such as display clear and cursor shift, and address information for display data RAM (DDRAM) and character generator RAM (CGRAM). The DR temporarily stores data to be write into DDRAM or CGRAM and temporarily stores data to be read from DDRAM or CGRAM. Data written into the DR is automatically written into DDRAM or CGRAM by an internal operation. The DR is also used for data storage when reading data from DDRAM or CGRAM. When address information is written into the IR, data is read and then stored into the DR from DDRAM or CGRAM by an internal operation.
3.1.2 Busy Flag (BF)
The Lcd controller chip needs some time to execute the instruction or data write, and whenever it receives something it starts this internal operation routine that takes time, during this time the controller will be busy and will not understand anything else that you send. So, it will be necessary to wait a little bit after you send something to the LCD. How long is it? Nobody knows, it depends on the controller type and operation, and it can varies. You can build a "wasting time" routine to wait for some time after each write to the LCD, but it will be or too short, or too long because you would never know how long will be enough. For example, the Clear command takes the longest time, a simple data write not too long.
To avoid guessing and testing, just use a simple way to check if the LCD controller is busy or not, there is the busy bit.
After writing to the LCD, send a "read instruction" and check bit 7, this is the busy bit, a high level means the controller still busy, a low level means the controller finished the previous operation and is available to receive more bytes.
BACK to Content Page
. Next Page
. Previous Page
LCD overview :-
We probably use items containing an LCD (liquid crystal display) every day. They are all around us -- in laptop computers, digital clocks and watches, microwave ovens, CD players and many other electronic devices. LCDs are common because they offer some real advantages over other display technologies. They are thinner and lighter and draw much less power than cathode ray tubes (CRTs),
Common-plane-based LCDs are good for simple displays that need to show the same information over and over again. Watches and microwave timers fall into this category. Although the hexagonal bar shape illustrated previously is the most common form of electrode arrangement in such devices, almost any shape is possible. Just take a look at some inexpensive handheld games: Playing cards, aliens, fish and slot machines are just some of the electrode shapes you'll see.
The HD44780 dot-matrix liquid crystal display controller and driver LSI displays alphanumeric characters and symbols. It can be configured to drive a dot-matrix liquid crystal display when interfaced with a processor. A single HD44780 can display up to one 8-character line or two 8-character lines.HD44780 supports 8 dot character fonts and 32 5 ´ 10 dot character fonts for a total of 240 different character fonts.
3.1 Function Description
The following section will introduce the user with some of the important features of the liquid crystal display, that are important for interfacing with the liquid crystal display through software.
3.1.1 Registers
The HD44780 has two 8-bit registers, an instruction register (IR) and a data register (DR).The IR stores instruction information, such as display clear and cursor shift, and address information for display data RAM (DDRAM) and character generator RAM (CGRAM). The DR temporarily stores data to be write into DDRAM or CGRAM and temporarily stores data to be read from DDRAM or CGRAM. Data written into the DR is automatically written into DDRAM or CGRAM by an internal operation. The DR is also used for data storage when reading data from DDRAM or CGRAM. When address information is written into the IR, data is read and then stored into the DR from DDRAM or CGRAM by an internal operation.
3.1.2 Busy Flag (BF)
The Lcd controller chip needs some time to execute the instruction or data write, and whenever it receives something it starts this internal operation routine that takes time, during this time the controller will be busy and will not understand anything else that you send. So, it will be necessary to wait a little bit after you send something to the LCD. How long is it? Nobody knows, it depends on the controller type and operation, and it can varies. You can build a "wasting time" routine to wait for some time after each write to the LCD, but it will be or too short, or too long because you would never know how long will be enough. For example, the Clear command takes the longest time, a simple data write not too long.
To avoid guessing and testing, just use a simple way to check if the LCD controller is busy or not, there is the busy bit.
After writing to the LCD, send a "read instruction" and check bit 7, this is the busy bit, a high level means the controller still busy, a low level means the controller finished the previous operation and is available to receive more bytes.
BACK to Content Page
. Next Page
. Previous Page
No comments:
Post a Comment