8051 basic programming tutorial: In the following 8051 tutorial i used books to learn fundamental knowledge about Embedded system. After that i install Kiel compiler and Proteus simulator tool to implement following basic 8051 programming tutorial:
Interfacing of LCD with 8051: In this tutorial LCD is interfaced with 8051(AT89C51) controller. If you want to learn more kindly see tutorial on youtube as well.
>> LCD interface with 8051 C Code: #include<reg51.h> #define PIN P2 sbit rs=P3^0; sbit rw=P3^1; sbit e=P3^2; void delay(int t) { int i,j; for(i=0;i<t;i++) for(j=0;j<1275;j++); } void dat(unsigned char x) { rs=1; // for selecting data register rw=0; // for write purpose PIN=x; e=1; delay(5); e=0; } void cmd(unsigned char x) { rs=0; // for selecting command register rw=0; // for write purpose PIN=x; e=1; delay(5); e=0; } void init() { cmd(0x38); cmd(0x01); cmd(0x0e); cmd(0x06); cmd(0x80); } void lcd(unsigned char *p) { while(*p!='\0') { dat(*p); p++; } } void main() { PIN=0x00; // output port rs=rw=e=0; init(); //to initialize the lcd lcd("Welcome to"); cmd(0xc0); // forcing cursor to beginning of 2nd line lcd("Microzone India!"); while(1); // for holding the content on lcd } >> Proteus Design Schematic: