free 8051 Microcontroller Projects AVR PIC Microcontroller Projects Tutorials Ebooks Libraries, interfacing tutorials, lcd tutorial, stepper motor, dc motor 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems

 
8051 microcontroller 8051 microcontroller
Forums

Go to page  1 [2]
Moderators: Ajay, Junied , abbas1707, Arun Kumar V, pdi33, Shailesh NAYAK, ۞ TPS ۞, shyam, sashijoseph
Author Post
weijie
Sun Jul 13 2008, 08:23PM
 User Offline
Registered Member #8603
Joined: Tue Jun 24 2008, 11:22PM

Posts: 10
Thanked 0 times in 0 posts
@sashijoseph

the line of " for( i=0 ; i<750 ; i++) " is use to ?
eg : lets say i call void delay(160) , then the result delay will be ? crystal that i using is 22.184MHz
my delay aim are use to generate delay in term of microsecond as the minimum time to execute a command for LCD is 40us.
Is it better to check busy flag compare to using delay ? because some forum comment that checking busy flag is not advisable to use .



[ Edited Sun Jul 13 2008, 08:27PM ]
Back to top


Arun Kumar V
Mon Jul 14 2008, 12:46AM

 User Offline
Registered Member #426
Joined: Sun Jan 28 2007, 11:50PM

Posts: 427
Thanked 178 times in 149 posts

Checking Busy flag is always better, bcoz it gives the controller inside the LCD sufficient time to complete what its doing (internally).

on the other hand, the delay which we do in the code may or may not give the LCD controller enough time for its internal operation.


also checking busy flag method enables you to use same code on different micros (Single cycle micro or 12 cycle normal micro) without recalculating delay timings and machine cycle time.



Arun






Back to top


weijie
Mon Jul 14 2008, 07:24AM
 User Offline
Registered Member #8603
Joined: Tue Jun 24 2008, 11:22PM

Posts: 10
Thanked 0 times in 0 posts
thks alot ~
my circuit are working already ... thks for the help everyone
Back to top


weijie
Sat Jul 26 2008, 08:34AM
 User Offline
Registered Member #8603
Joined: Tue Jun 24 2008, 11:22PM

Posts: 10
Thanked 0 times in 0 posts
void LCD_busy()
{
LCD_D7 = 1; //Make D7th bit of LCD as i/p
LCD_en = 1; //Make port pin as o/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_en = 0; //Enable H->L
LCD_en = 1;
}
}

according to the code above, we need to set the LCD_en as 1 as a output port .
But why when checking the busy flag(LCD_D7) , it is toggled from 0 to 1 but not 1 to 0 ? i thought we should use toggle from high to low every time ?
Back to top


sashijoseph
Sat Jul 26 2008, 07:26PM

 User Offline
Registered Member #5870
Joined: Mon Feb 04 2008, 06:26PM

Posts: 524
Thanked 124 times in 117 posts
Hi....
In the above code LCD_en = 1; //Make port pin as o/p is not needed.
If you look at the LCD timing diagram,a read requires EN->L to H strobe while a write requires H to L.
Since you are reading the busy flag,a L to H is reqd for the enable pin.

[ Edited Sat Jul 26 2008, 07:28PM ]

Let there be music........
Back to top


Go to page  1 [2]  

Jump:     Back to top

Syndicate this thread: rss 0.92 Syndicate this thread: rss 2.0 Syndicate this thread: RDF
Powered by e107 Forum System

8051 Microcontroller Projects 8051 AVR tutorials PIC microcontroller, 8051 assembly language programming electronics and communication ECE CSE pdf ebooks library BE final year project ideas Embedded systems