Newsgroups: comp.robotics
Path: brunix!sgiblab!sgigate.sgi.com!olivea!spool.mu.edu!howland.reston.ans.net!pipex!sunic!trane.uninett.no!eunet.no!nuug!EU.net!uunet!hobbes!earth.armory.com!rstevew
From: rstevew@armory.com (Richard Steven Walz)
Subject: Re: C and the printer port?
Organization: The Armory
Date: Sat, 23 Jul 1994 11:46:28 GMT
Message-ID: <CtE61I.IyG@armory.com>
References: <1994Jul17.153810.18312@news.vanderbilt.edu> <Ct7Dut.2Fz@armory.com> <1994Jul20.191648.6258@news.csuohio.edu>
Sender: news@armory.com (Usenet News)
Nntp-Posting-Host: deeptht.armory.com
Lines: 45

In article <1994Jul20.191648.6258@news.csuohio.edu>,
Darryl Palmer <dpalmer@csuohio.edu> wrote:
>
>Richard Steven Walz (rstevew@armory.com) wrote:
><deleted tons>
>: Here's the code. You'll want to change that delay number to change speed.
>: Maybe add a conditional change in the read data address to control
>: direction. Add a value entry loop to change the delay while running. Cute
>: project.
>: -Steve Walz
>
>I don't know if the original poster knows enough about assembly or not, but
>using Richard's code will certainly worked if modified a bit.  Note that 
>to get a responsible speed for your stepper motor you will have to either
>write a nested nop loop to eat up the time.  A better way would be to try
>and trap the time interrupt (that is if you want it that slow), or you can
>redefine the keyboard timer.  If you do use C, you can use one of the timer
>functions or even the C++ Timer Library (Made by one of the programming guru's
>on C$erve).  I don't know what actual speed you want, but the C++ Timer Lib,
>available at probably tons of places, is able to get at least ms time
>resolution.
>
>If you do it in assemble remember some points.
>1) Be nice to the computer and don't disable the interrupts for too long,
>   you could start losing time. :)
>2) It is hard to time the performance of assembly code (Because of the
>   multitude of hardware) so just tweak it for one computer or try and use
>   one of the timers if you want to use it for multiple computers.
>3) If you want to make it really nice, hook up a scope to the computer and
>   see how stable the pulses are.
>4) Be careful with the computer, you don't want to blow out your port.
>   Try to build in some safeguard into the system, so you don't take 
>   everything down. (Luckily when a device I had to my serial port blew it
>   only reset my computer, but then there are unlucky people)
>
>
>Darryl Palmer
-----------------------
Thanks, Darryl, very apt.
My clock does lose time, but I usually use it with a batch file to reset
the DOS clock with the RTC prog. In AT's I just reset it manually.
And I ALWAYS use an external buffer on my parallel port, so if something
burns it, I just pop another chip in the extenal socket!
-Steve Walz   rstevew@armory.com 

