Header Ads

Interfacing LCD with At mega 16/32

Here is a new possible way of interfacing LCD with our controller other than what we have done earlier.

About LCD (Liquid Crystal Display 16X2):-
Its 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 and other multi segment LEDs.

LCD Complete Tutorials for beginners


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.

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, namely, Command and Data.

The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The 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.

You can connect 8 data pins of LCD to any ports like PORT A/B/C/D. Since we are using Port A for ADC,it is not advisable to connect LCD there. In this particular schematics Pins 33 to 40 are connected to LCD ,but for our projects we will be connecting data pins of LCD on Port C ie. 7 pin on C0 and 14 on C7 and so on.


Three control lines ie. 4,5,6 should be connected as shown(to PORT B).

Since LCD is External hardware,we have to define its address line and control line and have to use them in our program.(Now you can not use LCD.h and LCD.c as we were doing earlier). Now you have to write your own new codes for everything.

Anyone who don't want to do this much effort can simply copy the connection from our Development Board,on which we have been doing testing.

Thanks & Regards
techinventory

No comments