LCD

INTRODUNCTION OF LCD DISPLAY


WHAT IS LCD??


The LCD is a very different piece of technology than is the CRT. LCD screens have long been used on notebook computers, but are also becoming increasingly popular as a desktop monitor as well. Prices for these screens uses to be quite high, but they are coming down. They are still much more costly than a CRT, but they are cheaper nonetheless.
The way in which LCDs work is completely different than the CRT. They work off of some principals in chemistry that are quite interesting.
You 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.

LCD (2x16) interface to Atmega 16




In this tutorial we are going to interface a 2x16 LCD to Atmega 16 microcontroller and simulate it using proteus software and explain how to display variables on LCD in an easy way.
The editor we are going to use is codevision avr compiler.



 

 Steps

1-open the editor and select the wizard as shown in the following picture

 2- select the chip tab and choose your microcontroller here we are using Atmega 16 so we select it , then select the frequecny for your chip in this example ( 8 Mhz)
3-then select LCD tab and choose the PORT you want to connect  LCD to (example : PORTC).
   then choose the type of your LCD where 16 is the LCD 2x16 character
   (NOTE : Atmega 16 has 4 PORTS : PORTA,PORTB,PORTC,PORTD)
4- now you have finished initialization of your code, to see your code select file > generate,save and exit.
    then save your file (the program will ask you to save three files save them in the same folder with the same name) . after you save your files your code will be displayed .
( NOTE : the underlined word determines which port the lcd is connected to and since we choose PORTC , the number 0x15 is written where 0x15 is the address of PORTC in the I/O registers of Atmega 16 e.g. if want PORTA >> 0x1B , PORTB >> 0x18 , PORTD >> 0x12 )
5- at the end of the code you will find while (1) where we place the main program of the microcontroller. Now we have to give a look at the lcd functions.

LCD Functions

1- lcd_clear( ) :

clears the LCD and sets the printing character position at row 0 and column 0. (char position will be explained in the next function )

2- lcd_gotoxy(x, y)

sets the current display position at column x and row y. The row and column numbering starts
from 0. 
for example : lcd_gotoxy(11,1) will set the pointer at the location arrowed in the following figure i.e. the next character will be displaye at row #1 and column #11

3- lcd_putchar(c)

displays the character c at the current display position.(used to display variables)

4- lcd_puts(char *str)

displays at the current display position the string str, located in RAM.

5- lcd_putsf(char flash *str)

displays at the current display position the string str, located in FLASH.(used to display strings i.e. words)
for examlpe : lcd_putsf( "Hello World!!!") >> the string Hello World!!! will be displayed as it's i.e. any thing between double qoutes will be displayed as it's.

                             WHAT IS GRAPHIC LCD??

A graphic LCD (liquid crystal display) is an electronic visual display technology used in different gadgets and information-output sources, mostly in display screens of electronic devices. This technology employs manipulating tiny crystals of a contained liquid crystal solution through precise electronic signals to perform graphic display operations over a two-dimensional physical screen. LCD technology is considered the successor of conventional CRT (cathode ray tube) visual display technology, which uses electron-firing gun to produce a pixel-based display over monitor screens.









No comments:

Post a Comment