By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,092 Members | 1,546 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,092 IT Pros & Developers. It's quick & easy.

help with sending data out the parallel port

P: n/a
I'm wondering if python is capable of fairly precise timing and also sending
data out the parallel port.

For example ; making a 7.5 KHz square wave come out of one of the data pins
on the printer port.

I've tried to help myself with this one but searching in the "Python Library
Reference" that installed with my version, [ Python 2.4.1. ] yielded
nothing on the subject of either timing or parallel port.

Id be thankful for any help.

David KG2LI
Oct 27 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Wed, 26 Oct 2005 20:33:33 -0400, "David" <pd***@comcast.net>
declaimed the following in comp.lang.python:
I'm wondering if python is capable of fairly precise timing and also sending
data out the parallel port.
If you are on Windows, you have two things to worry about:

1) The NT family doesn't give direct access to the port without
first installing some special driver program -- and you probably need
that as regular sending of data to the port will likely hang from a lack
of handshaking.

2) Windows itself may get in your way. I don't remember the exact
speed I was working with but 1KHz seems to stick in mind. My assignment
was to output data (faking three parallel RS-422 <?> signals using 6
bits of the output byte) synchronized to an external clock (which was
read on a control pin of the parallel port). I could send about 196-254
bit transitions before the OS would do something that would cause me to
miss a few clock transitions. This, on an application written in VC++6,
on W98 (to get unrestricted access to the port). The application was
running with its priority set to the highest available.
-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Oct 27 '05 #2

P: n/a
David wrote:
I'm wondering if python is capable of fairly precise timing and also sending
data out the parallel port.

For example ; making a 7.5 KHz square wave come out of one of the data pins
on the printer port.

I've tried to help myself with this one but searching in the "Python Library
Reference" that installed with my version, [ Python 2.4.1. ] yielded
nothing on the subject of either timing or parallel port.


What are you trying to use this for? What kind of jitter does your
specification allow? (That is, since you can't get the edge transitions
exactly 66.6 microseconds apart all the time, how much variation are you
able to handle?) What will happen if, say, once every five or ten
seconds the OS hiccups and prevents your task from running for a full
second?

Doing this kind of high-speed realtime control on a non-realtime
operating system is generally difficult or impossible, but it does
depend on how precise you need to be, and how "soft" your realtime
requirements are. My gut feeling is that you cannot achieve what you
want using Python on Windows (or Linux!), but it depends on your needs,
not my gut. :-)

-Peter
Oct 27 '05 #3

P: n/a
You don't want to use Python for that task. You're much better off
using the Microsoft DDK (driver development kit).

Oct 27 '05 #4

P: n/a
I may have a solution to your problem that involves a small piece of
hardware plugged into the serial port.
contact me if interested in details.
jo*********@comcast.net
Sent via Archivaty.com
Nov 5 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.