sending bytes to parallel port

Timothy Smith timothy at open-networks.net
Sat Jul 29 01:26:36 EDT 2006


Dennis Lee Bieber wrote:
> On Sat, 29 Jul 2006 13:59:02 +1000, Timothy Smith
> <timothy at open-networks.net> declaimed the following in comp.lang.python:
>
>   
>> and yes i've done quite a bit of googling, i never expected it to be 
>> this difficult. i've done work with serial ports before. never parallel but.
>>     
>
> 	Parallel gets ugly -- there are something like three different types
> of parallel port hardware, and they behave slightly differently (status
> bits, bidirectionality, etc.).
>
> http://www.amazon.com/gp/product/0965081915/qid=1154149492/sr=2-1/ref=pd_bbs_b_2_1/002-3804298-8662433?s=books&v=glance&n=283155
>
> is MS-DOS/Windows biased, but may give hints...
>
>
> (a few years ago I had to program a W98 laptop to write 6 data pins --
> representing three rs-422 style balanced signals -- in response to a
> 1KHz clock signal coming in on another pin... I had it working, but
> couldn't get rid of every last W98 OS interrupt, such that I had a 1-3
> clock length skip about every 700 clocks)
>   
i think fcntl is what i'm after, although i've never done any system 
level stuff like this before so it's a learning curve for me.
right now i'm attempting to use it like so and getting the following error.

 >>> fd = open('/dev/ppi0','w')
 >>> fcntl.ioctl(fd.fileno(),'PPISCTRL',10000000)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: an integer is required

i guess i'm failing to properly define the int i need for the 8byte 
value ineed to send the port to set pins high /low





More information about the Python-list mailing list