AIM: Interface LCD and keypad with 8051 using C language and implement it as
real time hardwear. CIRCUIT DIAGRAM: PROGRAM: #include.
A Project Report On
“LCD & KEYPAD INTERFACING WITH 8051 USING C LANGUAGE”
Guided By: Prof. Mr. Utkal Mehta
Prepared By: Nikhil Patel (09EC081) Mehul Patel (09EC078)
V.T. Patel Dept. of Electronics & Communication Engineering. C.S.Patel Institute of Technology Charotar University of Science & Technology
AIM: Interface LCD and keypad with 8051 using C language and implement it as real time hardwear.
CIRCUIT DIAGRAM:
U2
K1 A
4
5
6
B
7
8
9
C
DTMF_KEYPAD VCC 5V
*
0
#
D U1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
VCC 5V C1 10µF 10kΩ R1 GND
X1
HC-49/U_11MHz
GND
PROGRAM: #include sbit rw=P3^5; sbit rs=P3^6; sbit en=P3^7; void fordelay(void); void checkclm(void); void printdata(void); void fordata(unsigned char);
P1B0T2 P1B1T2EX P1B2 P1B3 P1B4 P1B5MOSI P1B6MISO P1B7SCK RST P3B0RXD P3B1TXD P3B2INT0 P3B3INT1 P3B4T0 P3B5T1 P3B6WR P3B7RD XTAL2 XTAL1 GND
VCC P0B0AD0 P0B1AD1 P0B2AD2 P0B3AD3 P0B4AD4 P0B5AD5 P0B6AD6 P0B7AD7 EAVPP ALEPROG PSEN P2B7A15 P2B6A14 P2B5A13 P2B4A12 P2B3A11 P2B2A10 P2B1A9 P2B0A8
8051
40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21
10kΩ Key=A
R9
GND 50%
D7 D6 D5 D4 D3 D2 D1 D0
3
E RS RW
2
VCC CV GND
1
void forcommand(unsigned int); unsigned int a,r,c,d,e,f,g; unsigned char b[4][4]={
'7','8','9','A', '4','5','6','B', '1','2','3','C', '*','0',' ','D'};
void main(void) { unsigned int z[4]={0xfe,0xfd,0xfb,0xf7}; for(f=0;f