You are on page 1of 4

Summary LCD is a very commonly used output device to display alphanumeric characters.

The LCD displays the character corresponding to the data received on its input data port i.e., it treats the data as the ASCII value of the character to be displayed. So if the value 65 is given to its data port the character A will be displayed and if the value 49 is given to the LCD the numeric digit 1 will be displayed. At many instances it is required to display a number like 123 on LCD. Displaying this number is tricky. If the data port of the LCD is loaded with the number 123, then the character corresponding to it will be displayed. This article shows the concepts behind displaying a number on LCD.The article uses 8051 microcontroller (AT89C51) to demonstrate the above principle.

The circuit is divided into two units: the controller unit and the display unit. The controller unit consists of a microcontroller circuit. The microcontroller used here is AT89C51 (for details of controller circuit, refer led blinking section). The display unit consists of a LCD interfaced to the microcontroller (for details of LCD interfacing circuit, refer lcd single character display section). To overcome the problem stated above, the number to be displayed is store in a variable. Then each digit of the number is fetched individually in an array. Since the ASCII value of 0 is 48, 1 is 49 and so on. Thus we come to the conclusion that the ASCII value of a digit (from 0 to 9) can be calculated by adding 48 to it. Thus 48 is added to each value of that array and assigned to the dataport of the LCD one by one. In this way, each digit of the number is displayed on the LCD and as a whole we have succeeded in displaying an integer number on the LCD. In this circuit, port 2 of the microcontroller has been used as dataport (or command port) and pin 0 of port 3 is connected to RS (resistor select) pin, pin 1 of port 3 is connected to RW (read or write) pin and pin 6 of port 3 is connected to enable pin of the LCD.

Components

Preset

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 a similar tool. The resistance does not vary linearly but rather varies in exponential or logarithmic manner. Such variable resistors are commonly used for adjusting sensitivity along with a sensor.

The variable resistance is obtained across the single terminal at front and one of the two other terminals. The two legs at back offer fixed resistance which is divided by the front leg. So whenever only the back terminals are used, a preset acts as a fixed resistor. Presets are specified by their fixed value resistance.

You might also like