How to interface 16x2 LCD with 8051 microcontroller (AT89C51)
- Circuit Diagram
- Free Circuit Design & Simulation Tool by TI
It is very important to keep a track of the working of almost all the automated and semi-automated devices, be it a washing machine, an autonomous robot or anything else. This is achieved by displaying their status on a small display module. LCD (Liquid Crystal Display) screen is such a display module and a 16x2 LCD module is very commonly used. These modules are replacing seven segments and other multi segment LEDs for these purposes. The reasons being: LCDs are economical, easily programmable, have no limitation of displaying special & even custom characters (unlike in seven segments), animations and so on. LCD can be easily interfaced with a microcontroller to display a message or status of a device. This topic explains the basics of a 16x2 LCD and how it can be interfaced with AT89C51 to display a character.
A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD each character is displayed in 5x7 pixel matrix. This LCD has two registers.
1. Command/Instruction Register - stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing, clearing the screen, setting the cursor position, controlling display etc.
2. Data Register - stores the data to be displayed on the LCD. The data is the ASCII value of the character to be displayed on the LCD.
Command to LCD Instruction Register
Clear screen display
Display ON, Cursor ON
Force the cursor to the beginning of the 1st line
Force cursor to the beginning of the 2nd line
Use 2 lines and 5x7 matrix
Main power supply
Power supply to control contrast
Contrast adjustment by providing a variable resistor through VCC
RS=0 to select Command Register
RS=1 to select Data Register
R/W=0 to write to the register
R/W=1 to read from the register
A high to low pulse (minimum 450ns wide) is given when data is sent to data pins
To display letters or numbers, their ASCII codes are sent to data pins (with RS=1). Also instruction command codes are sent to these pins.
8-bit data pins
A preset is a three legged electronic component which can be made to offer varying resistance in a circuit. The resistance is varied by adjusting the rotary control over it. The adjustment can be done by using a small screw driver or...
LCD (Liquid Crystal Display) screen is an electronic display module and find a wide range of applications. A 16x2 LCD display is very basic module and is very commonly used in various devices and circuits. These modules are preferred over seven segments...
Free Circuit Design & Simulation Tool by TI
TINA-TI is a powerful circuit design and simulation tool. TINA-TI is ideal for designing, testing, and troubleshooting a broad variety of basic and advanced circuits, including complex architectures, without any node or number of device limitations.
TINA is an easy-to-use, powerful circuit simulation tool based on a SPICE engine. TINA-TI is a fully functional version of TINA, loaded with a library of TI macromodels plus passive and active models.
TINA-TI's new version 9 has changes from Version 7.0 in the following areas:
- Schematic Symbol Editor (useable with the Macro Wizard) is included, so you can create your own symbols for imported SPICE macromodels.
- Macros do not have to be from TI - you can import anyone's SPICE model now!
- Does not require active or non-linear components for analysis (so you can now run a circuit using just passives).
- TINA-TI includes Initial Condition and Nodeset components
- TINA-TI includes Linear and nonlinear controlled sources (VCVS, CCVS, VCCS, CCCS), and the Controlled Source Wizard.
- TINA-TI now allows WAV files to be used as stimulus (signal sources). You can play calculated waveforms on PC's multimedia system, and export calculated waveforms as a *.wav file.
- TINA-TI has Multi-core processor support; this along with other optimizations makes simulations run 2-20 times faster.
- Schematic file import/export in XML format
- Block Wizard included for making block diagrams
- TINA-TI has more SPICE models and example circuits included.
- Circuits developed in TINA-TI 9 will work with TINA Industrial version 9.
- TINA-TI Version 7.0 is forward compatible with Version 9, and version 9 supports saving schematics in version 7.0 format.
- Available in English, Traditional and Simplified Chinese, Japanese, and Russian versions.