[ARM] How to interface 20x4 LCD display with ADuC7026?

Status
Not open for further replies.

Dinagar

Newbie level 2
Joined
Sep 22, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,299
I am working on the project with ADuc7026 microcontroller. I would like to interface 20x4 Lcd Display with controller. I have tried the initialisation of LCD display from the lcd library. Only First line and third line get initialised. I need some help to get out of this issue.
 

Can you put up the code,which you used to initialize the 20X4 LCD module,the main code/driver code..?
 

This is my 20x4 LCD driver code. Kindly see it.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*
RS pin = Port 3.4
R/W pin = Port 3.5
E pin = Port 3.6
 
Data 7 = Port 3.0
Data 6 = Port 3.1
Data 5 = Port 3.2
Data 4 = Port 3.3
*/
 
 
#define RSL GP3CLR=0x00100000;
#define RSH GP3SET=0x00100000;
#define RWL GP3CLR=0x00200000;
#define RWH GP3SET=0x00200000;
#define EL GP3CLR=0x00400000;
#define EH GP3SET=0x00400000;
 
 
void initlcd(){
GP3CON = 0;
GP3SET = 0x7F000000;
delay(15000);
RSL;
write(0x30);
delay(4100);
write(0x30);
delay(100);
write(0x30);
write(0x2);
write(0x38);
write(0x08);
write(0x01);
write(0x06);
}
 
void setcursor(unsigned char col, unsigned char line_addr){
unsigned char addr;
addr = line_addr+ col;
addr = 0x80 + (addr & 0x7f);
write_cmd(addr);
}
 
void lcdclr(void){
write_cmd(0x01);
setcursor(0,0);
}
 
void write(unsigned char a){
RWL;
EH;
GP3CLR = 0xFF000000;
GP3SET = (a & 0xF)<<16;
delay(10);
EL;
delay(10);
}
 
void write_cmd(unsigned char a){
chk_busy();
RSL;
write(a>>4);
write(a);
}
 
void write_data(unsigned char a){
chk_busy();
RSH;
write(a>>4);
write(a);
}

 
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…