To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 3745
3744  |  3746
Subject: 
My LCD driver
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Sun, 3 May 1998 06:38:38 GMT
Original-From: 
Chuck McManis <cmcmanis@SAYNOTOSPAMnetcom.com>
Viewed: 
1289 times
  
Attached to this message is the LCD driver I wrote for the Handyboard
written using ICC11. Feel free to use it.

Some notes on it:

The driver is designed to operate asynchronously. This is because the
LCD can take several milliseconds to complete its operations. If you
busy-wait and the LCD has just started something, you will sit there
waiting, with interupts blocked, yuck!

The main driver is a routine called 'do_lcd()' it is called by my system
'tick' interrupt every millisecond. It checks to see if there is
anything in the queue for the LCD and then it checks to see that the LCD
driver is installed in the zero page of RAM. If neither is true it
returns.

When there is something to do, the driver dereferences a pointer to call
lcd_write(). That routine turns off interrupts, flips the 68HC11 into
single chip mode, and checks to see if the LCD is busy, if it is, it
returns, otherwise it dequeues a character and writes it to the LCD and
returns. In either case it is back out of single chip mode with
interrupts back on in a few microseconds.

In either event, I call lcd_write once a millisecond (if it something to
do) and if doesn't manage to accomplish anything in 10 tries (ie 10mS)
then I set a flag to indicate the LCD is not working. This keeps the
board from hanging if you unplug the LCD.


--Chuck

P.S. I've also attached an S19 file that shows it in operation.

--
MIME ATTACHMENTS DISCARDED:

1.  Content-Type: application/x-unknown-content-type-cfile; name="Lcd.c"
    Content-Transfer-Encoding: base64
    Content-Disposition: inline; filename="Lcd.c"
    Content-Length: 9227

2.  Content-Type: text/plain; charset=us-ascii; name="Lcdtest.s19"
    Content-Transfer-Encoding: 7bit
    Content-Disposition: inline; filename="Lcdtest.s19"
    Content-Length: 6855



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR