Figuring out the Printer port base address

Chris Liechti cliechti at gmx.net
Sun Dec 29 15:37:23 EST 2002


akineko at pacbell.net (Aki Niimura) wrote in
news:b714b8de.0212291135.73671c69 at posting.google.com: 

> Hi Chris,
> 
> Thank you very much for your prompt response.
> I checked out your mspgcc Home page (http://mspgcc.sourceforge.net/).
> It was very impressive. My application is very similar to your pyJTAG.
> I have a JTAG solution for Unix and now I'm trying to port it to
> Windoze. 
> 
> Anyway, I have several questions to ask if I may:
> (1) parallel
>> i have my own solution here... it runs on linux and win32
>> http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/pyserial/pyparallel/
> 
> Your 'prallelwin32.py' seems using a fix port address.

well, you can select LPT1 or 2 on initialization, using other addresses 
only needs a small hack. sure, that could be done more flexible in my 
module...

>| LPT1_base = 0x0378
>| LPT2_base = 0x0278
>|
>| import _pyparallel
>|
>| class Parallel:
>|     def __init__(self, port = LPT1):
>|         if port == LPT1:
>|             self.dataRegAdr = LPT1_base
>|         elif port == LPT2:
>|             self.dataRegAdr = LPT2_base
> 
> (2) giveio
>> i use the giveio driver which i use in my package, it allows to do
>> that. you can get giveio seprately here 
>> http://sourceforge.net/project/showfiles.php?group_id=42303&release_id
>> =1197 87 where i wrapped it with an installer. (but then you need to
>> do some C) 
> 
> I only found the binary format of 'giveio'. Could you elaborate the
> detail how to determine the LPT1 base address in the 'giveio' module?

i have not used LPT detection yet, but i think you should try to use the 
code you posted with _pyparallel.inp() and .outp().

(giveio is needed to allow access to these ports on win NT/2k/XP. )

chris

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list