Searching \ for '[EE]:writing data to IBM PC parallel port to drive' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/mems.htm?key=data
Search entire site for: 'writing data to IBM PC parallel port to drive'.

Exact match. Not showing close matches.
PICList Thread
'[EE]:writing data to IBM PC parallel port to drive'
2000\12\28@160244 by Pramod Kotwal

flavicon
face
This is about using an IBM PC parallel port to drive a bipolar stepper
motor. So I hope it not too far off topic here.

I would like to use C to to send the appropriate signal to the data port
bits on the parallel port. P.H. Anderson gives a very nice and clear
explanation of how to do it .

The problem I have is in defining the delay between two subsequent commands
to write the bit to the port. This time interval will define how fast the
motor will turn.

The command to wrie data to the port is
outportb(port address, data).

The interval between writing data is controlled by the
delay(time) command.
This command seems to read time in milliseconds.

If this correct, the shortest delay I can specify is 1 millisecond between
steps. This would mean that on stepper motor with 200 steps per revolution I
can, at best get 5 rpm.

This does not make sense to me. Where am I going wrong ?

I will appreciate help.
Pramod Kotwal

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\28@161954 by John De Villiers

flavicon
face
dont use delay - its too slow

I think the trick was to do a port read ( one of the status bits or
something equially arbitary ). Those take 1 microsecond

The fastest i was able to go was about 50 us before the stepper started
skipping beats. It also depends if youre half stepping or full stepping. I
also suggest you use a tranny of some sort as the pc par port can let out
its smoke if you draw too much from it. I used normal TIP31's as i had a
whole box full of them.

I found full stepping, but with 2 coils energized ( half step position, but
full step increments ) gave me the best torque.

John

{Original Message removed}

2000\12\28@164141 by Herbert Graf

flavicon
face
{Quote hidden}

    Nowhere, that is about the best you will get using the delay routine.
Solution? Don't use the delay routine! As a small good side to this is I
have found that the delay routine isn't very good, multitasking environments
seem to really screw it up. How important is the accuracy of how fast you
need to go? If it isn't too critical you can use a simple FOR loop as a
delay. Stick an inp to nowhere in the loop (since inp's can't be cached they
almost always take an equal amount of time to execute) and run through the
loop a bunch of times. Unfortunately this is highly machine dependant. If
you do indeed need good accuracy or machine independence you'll have to do
it another way. Interrupts would probably be the solution using the timer in
every PC. Unfortunately this is MUCH more complicated to accomplish well.
TTYL

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2000\12\28@164437 by Pramod Kotwal

flavicon
face
Hi John,

Thanks for the tip.

If I understand you correctly, if I make a loop and read from a status port
n times before writing the next step I should get an interval of n
microseconds.

Neat.

I am not planning to use the port to drive the coils directly. Thanks for
the warning.
Pramod

----- Original Message -----
From: "John De Villiers" <spam_OUTbbjTakeThisOuTspamPLZ.CO.ZA>
To: <.....PICLISTKILLspamspam@spam@MITVMA.MIT.EDU>
Sent: Thursday, December 28, 2000 4:15 PM
Subject: Re: [EE]:writing data to IBM PC parallel port to drive stepper


{Quote hidden}

but
> full step increments ) gave me the best torque.
>
> John
>
> {Original Message removed}

2000\12\29@011523 by Roman Black

flavicon
face
Pramod Kotwal wrote:
>
> This is about using an IBM PC parallel port to drive a bipolar stepper
> motor. So I hope it not too far off topic here.
> The problem I have is in defining the delay between two subsequent commands
> to write the bit to the port. This time interval will define how fast the
> motor will turn.
>
> The command to wrie data to the port is
> outportb(port address, data).
>
> The interval between writing data is controlled by the
> delay(time) command.
> This command seems to read time in milliseconds.

You can use high res timinbg quite painlessly with the
PC, you sense the PIT timer chip and get a count in
microseconds, (actually 1.194MHz going from my memory)
and you can then loop and sense this count and time
things quite accurately. I did 3 years as a games
graphics engine programmer, had to time everything by
vertical retrace for screen draws.
:o)
-Roman

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\29@015434 by Nigel Goodwin

flavicon
face
In message <003d01c07110$8cbebde0$6501a8c0spamKILLspamprospeed.net>, Pramod Kotwal
<.....pramodkotwalKILLspamspam.....NITRON.NU> writes
>The interval between writing data is controlled by the
>delay(time) command.
>This command seems to read time in milliseconds.
>
>If this correct, the shortest delay I can specify is 1 millisecond between
>steps. This would mean that on stepper motor with 200 steps per revolution I
>can, at best get 5 rpm.
>
>This does not make sense to me. Where am I going wrong ?

Only in that the speed would be 5 revs per SECOND - not per minute!,
giving a maximum speed of 300rpm. Given that this is the PICList, why
not use a PIC to interface between the serial port and the stepper
motor, you could than send commands to the PIC via the serial port, and
the PIC can do all the fast timing required?.
--

Nigel.

       /--------------------------------------------------------------\
       | Nigel Goodwin   | Internet : EraseMEnigelgspam_OUTspamTakeThisOuTlpilsley.co.uk           |
       | Lower Pilsley   | Web Page : http://www.lpilsley.co.uk       |
       | Chesterfield    | Official site for Shin Ki and New Spirit   |
       | England         |                 Ju Jitsu                   |
       \--------------------------------------------------------------/

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\29@101237 by Pramod Kotwal

flavicon
face
Hi,

I realized that I would be getting 300 rpm after I had already sent the mail
to the PIClist. Thanks anyway.

I did learn about the trick of timing by reading data, so my request did
help me.

Using a PIC to do the timing is certainly an option that I am studyinng now.
I does have several advantages beyond the timing routines. So you might see
me here later if I run into difficulties.

Thanks for the pointers etc.
Pramod Kotwal

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2000\12\29@230415 by Daniel Jircik

flavicon
face
I have a  BUNCH of stuff i wrote in QBASIC a few years back, and it can use an
analog joystivk (db15 game) works great. If you would like them, will send to
you off list.
Daniel Jircik
pannomatspamspam_OUTswbell.net

Herbert Graf wrote:

{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...