Beruflich Dokumente
Kultur Dokumente
in
www.8051.in
number of color or monochrome pixels filled with liquid crystals. powered electronic devices because it requires very small amounts of electric power
www.8051.in
2
www.8051.in
An Example
www.8051.in
UNDERSTANDING LCD
www.8051.in
Dot Matrix
A 5X7 display consists of a
matrix of lights or mechanical indicators arranged in a rectangular configuration. By switching on or off selected lights, text or graphics can be displayed.
www.8051.in
6
www.8051.in
Pin Out
Pin-Description
8 data pins D7:D0:
Used to latch the data present on the data pins. A high-to-low edge is needed to latch the data.
VEE : contrast control
www.8051.in
Important Note:
For Contrast setting a 10K pot should be used as shown
in the figure. Two types of data is given to the LCD data to be displayed, command or special instruction.
www.8051.in
www.8051.in
from 80h to 8FH & for second line is C0H to CFH. So if we want to display 'H' on the 7th position of the first line then we will write it at location 87h.
www.8051.in
www.8051.in
www.8051.in
Project Assignment 4
www.8051.in
www.8051.in
Embedded C Program
#include<reg52.h> sfr ldata = 0x90; sbit rs = P2^0; sbit rw = P2^1; sbit en = P2^2; void lcdcmd(unsigned char value); void lcddata(unsigned char value); void msdelay(unsigned int itime); void main() { lcdcmd(0x38); msdelay(150); lcdcmd(0x0E); msdelay(150); lcdcmd(0x01); msdelay(150); lcdcmd(0x07); msdelay(150); lcdcmd(0x8B); msdelay(150);
www.8051.in
lcddata('C'); msdelay(150); lcddata('H'); msdelay(150); lcddata('I'); msdelay(150); lcddata('P'); msdelay(150); lcddata('A'); msdelay(150);
lcddata('D'); msdelay(150); lcddata('R'); msdelay(150); lcddata('O'); msdelay(150); lcddata('I'); msdelay(150); lcddata('T'); msdelay(150); lcddata('S'); }
www.8051.in
void lcdcmd(unsigned char value) { ldata=value; rs=0; rw=0; en=1; msdelay(1); en=0; return; } void lcddata(unsigned char value) { ldata=value;
rs=1; rw=0; en=1; msdelay(1); en=0; return; } void msdelay(unsigned int itime) { unsigned int i,j; for(i=0;i<itime;i++) for(j=0;j<1275;j++); }
www.8051.in
THANKS
Visit
www.8051.in
for more
www.8051.in