Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

8051 LCD programming

1 view
Skip to first unread message

ع„J

unread,
Aug 4, 2001, 10:27:26 AM8/4/01
to
Hi,

I have some problem about 8051 LCD programming. I found some book's LCD
programming example including LCD busy flag(BF) check subroutine, whereas
some examples do not have. Could anyone please tell me when do i need the
busy flag(BF) subroutine ?

Thanks.

flex...@hkstar.com

CBFalconer

unread,
Aug 4, 2001, 12:03:46 PM8/4/01
to
"邦仔" wrote:
>
> I have some problem about 8051 LCD programming. I found some book's LCD
> programming example including LCD busy flag(BF) check subroutine, whereas
> some examples do not have. Could anyone please tell me when do i need the
> busy flag(BF) subroutine ?

Most LCD controllers 'go busy' for about 40 uS when they receive a
char. If you send another during this period something will go
wrong. So you should guard your char send routine with a check
for 'not busy'. Something like:

WHILE lcdbusy DO (* nothing, wait *);
lcdput(ch);

Which can get into infinite loops if the appropriate wire is
loose.

--
Chuck F (cbfal...@yahoo.com) (cbfal...@XXXXworldnet.att.net)
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:u...@ftc.gov (for spambots to harvest)


Spehro Pefhany

unread,
Aug 4, 2001, 12:42:44 PM8/4/01
to
The renowned "J" <wing...@hongkong.com> wrote:

> I have some problem about 8051 LCD programming. I found some book's LCD
> programming example including LCD busy flag(BF) check subroutine, whereas
> some examples do not have. Could anyone please tell me when do i need the
> busy flag(BF) subroutine ?

When you don't use delays built into your routines.

Best regards,
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..." "The Journey is the reward"
sp...@interlog.com Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.BlueCollarLinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

ع„J

unread,
Aug 5, 2001, 1:37:20 AM8/5/01
to
Hi,

But why some LCD examples do not this Busy Flag (BF) check subroutine ?

Thank you.

--

ĻđĨJ <wing...@hongkong.com> wrote in message
news:9kh01a$n1...@imsp212.netvigator.com...

Spehro Pefhany

unread,
Aug 5, 2001, 2:37:37 AM8/5/01
to
The renowned "J" <wing...@hongkong.com> wrote:

> But why some LCD examples do not this Busy Flag (BF) check subroutine ?

Because they read the data sheet and put real-time delays in their
software larger than the slowest possible response of the display. They
assume the display has done its business when it's time to start the next
instruction.

Andre Buecker

unread,
Aug 7, 2001, 12:12:00 PM8/7/01
to
In order to use the busy flag, bit 7 of the data port
connected to the LCD needs to be able the be switched
to an input for the read, then back to an output for
the write.

The ports on an 8051 make this easy to do, ports on
other micros might be output only, then your forced
to use software delays after every write.

"ع„J" <wing...@hongkong.com> wrote in message
news:9kilbc$h1...@imsp212.netvigator.com...


> Hi,
>
> But why some LCD examples do not this Busy Flag (BF) check subroutine ?
>
> Thank you.
>
> --
>

> ع„J <wing...@hongkong.com> wrote in message

QPLAN

unread,
Aug 8, 2001, 1:16:14 AM8/8/01
to
Hi,

I'm a beginner in embedded, and would like to no more about state machines.
Can anyone recommend some good online doc or book?

Tnanks,
Akos


Super-User

unread,
Aug 8, 2001, 4:00:07 PM8/8/01
to

Do a search on "structured analysis and design" Last time we looked
there was a few tutorials
on line. Unfortunately I dont have the links here. Generally the
strauctured analysis and design
makes heavy use of State machines by dividing the design in data flow
analysis and modeiling the
control structures using state machines. Many like to use only the state
machines with tools like visual state (you may search on that too). The
object oriented design methods are of course more popular
nowadays, but tutorials on that tend to talk alot about classes and
objects and less about state
machines, the SA stuff may also be simpler to begin with.

If you have a specific question about state machines i may be able to
answer it directly.

Good luck,
Peter

0 new messages