Subject: Re: DELAY performance...
To: Josh Sandbrook <josh@petrieelectronics.com>
From: Jason Thorpe <thorpej@wasabisystems.com>
List: tech-misc
Date: 08/15/2004 08:34:40
--Apple-Mail-3-460247451
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; format=flowed


On Aug 14, 2004, at 9:38 AM, Josh Sandbrook wrote:

> Hello...
> Im writing a driver for an LCD ( HD44780 ) which is wired to the 
> printer port. Im having performance issues when throwing lots of data 
> to it.. and I think it is because of the DELAY function.
> With each byte I send out the printer port to the lcd, I need to call 
> DELAY() about 4 times, with about a 1100 usec delay in total. When I 
> send many megs to the lcd, I find that the rest of the system gets 
> very bogged down...
> AFAIK, DELAY halts the kernel from doing other things (except for 
> handling interrupts). I am guessing that is what is causing most of 
> the system slowdown..
> So, can anyone suggest a nicer way for me to delay ( even if it is not 
> as accurate )?

You can either use a state machine to output the bytes and use 
callout(9) to call your action functions after a period of time has 
passed, or might be able to use tsleep(9) (tsleep() can only be called 
from a process context, however).

         -- Jason R. Thorpe <thorpej@wasabisystems.com>


--Apple-Mail-3-460247451
content-type: application/pgp-signature; x-mac-type=70674453;
	name=PGP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFBH4KUOpVKkaBm8XkRAp11AJ9USgrGYY08fCjQQNi9s0oy5BD3OwCfdja3
5qRkegxqMKtSWlwd21AQbA4=
=OQ+r
-----END PGP SIGNATURE-----

--Apple-Mail-3-460247451--