LCD’s of Many kinds
Interfacing with avrPrayog
Each kind of LCD has its own specific protocol for its interfacing with outside world. However we will be learning about 16×2 alphanumeric LCD interfacing with avrPrayog here. Interfacing protocol of 16×2 alphanumeric LCD does not have any specific protocol name because the protocol is pretty simple, basically its not a protocol at all, its all about writing to registers, When you have control data make RS (register select) pin High-Low and choose whether the 8 bit data on D0-D7 is Control data or actual data to be displayed.
Figure below shows the Pin configuration of Standard HD44870 based LCD, in most of the standard modules the Pin Outs is written at the backside of LCD panel. Standard HD44870 alphanumeric module has 16 pins…
In case you don’t know, it runs on accurate 5V, you can control the back light using pin 15 and 16, these two Pins are for Back light control ON-OFF.
Schematic
Firmware
People have already written pretty nice, easy to use libraries for these kind of LCD interfacing, for AVR’s one such library was written by a guy name Peter Fleury You can download the 4 bit LCD interfacing Library here, See online user manual and function reference of Peter Fleury’s library here
Example Firmware using avr-gcc
#include < avr/io.h >
#include "lcd.h"
int main(void)
{
/* initialize display, cursor off */
lcd_init(LCD_DISP_ON);
/* clear display and home cursor */
lcd_clrscr();
lcd_gotoxy(3,0);
/* put string to display (line 1) with linefeed */
lcd_puts("avrPrayog\n");
lcd_gotoxy(1,1);
/* cursor is now on 1st char of second line, write second line */
lcd_puts("electroons.com");
while(1);
}
I code, I simulate, I make it real!



