Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

HY1602F6 LCD interfacing with 89s52 Microcontroller

Status
Not open for further replies.

neeteen09

Newbie level 5
Joined
Nov 25, 2016
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
94
Hi everyone,

I am facing issue with interfacing HY1602f6 LCD with AT89S52 microcontroller.

When i am programming controller & on next POWER ON , it displays correct messages.

But when I switch it off & on for the next time, it displays all pixel ON (of first row only.)

When again program controller , it shows correct messages.
(Again on the next power ON it displays all pixel on of first row)

Anyone have idea about this? Why it is showing all pixel ON on 2nd Power ON?

Thanks In Advance.
 

Sounds like you are not performing the specified LCD initialization by software with required delays.
 

my code to intialize lcd is :-


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
void lcd_init() // fuction for intialize 
{
dis_cmd(0x02); // to initialize LCD in 4-bit mode.
dis_cmd(0x28); //to initialize LCD in 2 lines, 5X7 dots and 4bit mode.
dis_cmd(0x0C);
dis_cmd(0x06);
dis_cmd(0x80);
}
 
 
void dis_cmd(char cmd_value)
{
char cmd_value1;
 //msb first
cmd_value1 = ((cmd_value>>4) & 0x0F); //shift 4-bit and mask
lcdcmd(cmd_value1); // send to LCD
    
    //lsb second
cmd_value1 = (cmd_value & 0x0F); //mask upper nibble because P0.0-P0.3 pins are used. 
lcdcmd(cmd_value1); // send to LCD
} 
 
 
void lcdcmd(char cmdout)
{
P0=cmdout;
rs = 0;
en=1;
delay1();   
en=0;
}
 
 
 
void delay1(void)
{
int i,j=0;
    for(j=0;j<=10;j++)
    {
    for(i=0;i<=100;i++)
        ;
    }
}

 

To consider worst case conditions, you should perform the 4-Bit initialization by instruction
 

Attachments

  • 4-bit Init.pdf
    7.7 KB · Views: 104

Thanks for your detailed reply.
But problem is solved yet by doing so.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top