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.

Busy flag checking of LCD in 4 bit mode for P89LPC936 controller

Status
Not open for further replies.

Vignya

Newbie level 4
Joined
Jul 31, 2009
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Mumbai
Activity points
1,323
Hi guys,
Can anyone give me code in C to check busy flag of LCD in 4 bit mode. My LCD code is working fine with delays but I want to do it with busy flag but dont know how to do it?

void set_D7_input(void)
{
P0M1=0x80;P0M2=0x7F; // i/p only
}

//=============================================================
void set_D7_output(void)
{
P0M1=0x00;P0M2=0xFF; // output only
}
//======================================
void LCD_busy()
{
set_D7_input(); //Make D7th bit of LCD as i/p
LCD_RS = 0; //Selected command register
LCD_RW = 1; //We are reading
while(LCD_D7){ //read busy flag again and again till it becomes 0
LCD_E = 0; //Enable H->L
us10_delay(1);
LCD_E = 1;
}
LCD_E = 0;
set_D7_output();
}

I tried to do it with just reading D7 bit but didn't worked. Is I hv to read the whole byte & then check D7?
 
Last edited:

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top