Thread: programming parrallel port input/output

  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    9

    programming parrallel port input/output

    Hello all. I hope that this isn't an easy one for you all as I have looked long and hard on the internet and the book stores and not found my answer. I used to program my parrallel port to take input and send output to relays to control motors and etc. put since the older computers I used to use are out of commission now and I have tried moving the software to newer computers with no luck.
    I used inline Assembly in a C program. I used to use windows 98 on pentium 1 or 2 processors now I'm on to windows XP Home and PRO with Pentium 4 processors, but the software comes up with errors and rewriting code or even just recompiling is full of error messages too. The Messages have a vague verbal explanation, but I think I have isolated the problem or one of them. When the new computers boot up there is power already on several of the pins of the parrallel port, not present on the old computers. Maybe Windows or the BIOS has already taken over control of the Port and I need to turn it off somehow?? Any Ideas would be gratifully appreciated as this simple hold up has fouled a huge project. Thanks You all. ~Mat

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    9
    I am not understanding what you mean by that.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    It means go and do some reading to find out how to do it properly using your current OS, rather than relying on increasingly dubious compatibility with your old OS.

    At some point, old code becomes truly broken and you HAVE to do something other than moan about it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You could have a look at WinIO.

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    9
    Well thanks guys... for all the HELP!! Atleast one person is curtious enough to point me in the right direction. I wasn't sure if it was the OS or the newer hardware or even the firmware. I have READ, but the closest library is 40 miles and has NO computer books, and the closest book store is about 2 hours away and has less than half a shelf of computer books and searching for books on the internet involving assembly language in XP has left few selections several of which I have bought costing a good amount of money and STILL (though there descriptions say otherwise) have no information on interacting with built in hardware. So what I was ASKING for was a few suggestions on where to look or what might be the problem. So Sorry that you guys know so much but are so unwilling to share!! If I hadn't read books, I would never have figured out how to program assembly or interface with serial ports in the first place, Maybe you guys should do less talking and more research!!

    BTW thank you ANONYTMOUSE I have seen your post many times on here and you always seem to be willing to help.. I appreciate it!!

  7. #7
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    stop whingeing because you cannot be bothered to do your own research. the link i gave you will lead you to plenty of information on programming the parallel port in all versions of windows. Also linked there are libraries that you can use including the one mentioned by Anonytmous. There are FAQ's and explanations of SPP, ECP and EPP. Did you bother reading any of it. Ever heard of google? Did you search these boards for previous examples? None of us are unwilling to share info with you because if that was the case what on earth are we botherring to come here for. The plain fact of the matter is that most of us haven't needed to access a parallel port in years and the amount of us here who write drivers to do so in XP numbers close to zero. Perhaps you should look for a more driver-authoring oriented forum and reask your query there.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  8. #8
    Registered User
    Join Date
    Oct 2005
    Posts
    9
    I did follow the links and they talk about the origin of the parallel port and IBM in the 80's and the specs of the port. ALL things that i have researched already. the codes are very similar to the ones that I used to make this project work on the old system. THEY AREN'T recent enough to help me. this is the problem. I have done MONTHS of research on this and you're link proves my point. Most people don't need to use the parallel port and so there is little information that is NEW on it. My main question is NOT how to access it or how it work or what the voltages are or any of that. I have already tested the port and found that NOW on the new computers I have access to it boots up with power to the port and I believe that is interferring with the programs attempt to access it. I believe that either the bios or XP has taken over control of the port and I am asking if anyone knows a NEW function or any NEW information on THIS or on how to return control of the port OFF so that I can access it again. I am not new to this, though I am maybe learning things now that you guys have known for years, our area doesn't have access to top technology and most people here don't even run XP YET.. so I am ahead of the curve for my area, but behind for yours. I don't need a primer on the parallel port, but on what could be different in XP or with the new hardware that might be stopping me from direct access to it. I have made a program that scans the com ports looking for the correct port address of the parallel port and found it to usually be 888/378 on most of the systems I have tried it on here, but on my newer systems with XP it compiles, but gives a runtime error and running it direct from windows it locks up the system. So obviously something is fighting with my program. I need some guidance in where to look for WHAT that might be. is the problem with XP or with my NEWer hardware. I would assume XP, but when I boot with LINUX the port powers on too, but I can access the ports with linux on two newer laptops, but not the desktops or another laptop, so that leads me to think that it's something to do with hardware (bios maybe) and maybe the laptops that work have older hardware or different firmware (since sometimes laptops are behind in new technology on the motherboards). Get what I am saying?? I don't need help with the basics so if you DON'T have any information that is RELEVENT or can't help than don't waste time calling me stupid or lazy when you don't even understand that I have gotten this far with LOT'S of research. GOOGLEs searchs aren't always the newest up to date information either and through many days of searchs and many different ways of wording it I still haven't found anything relevent except a few higher tech message boards, like this one, where I have been hoping someone might understand my situation and point me to a site that is NEW and explains the difference in accessing ports in XP on New hardware. I appreciate the link and followed it, must be my connection wasn't good the first few times because it didn't work the first few times, that's why I asked what it was about, but it's old news and no help. if there were previous examples on this board about programming parallel ports on XP on this board then I am sorry that I didn't see them. I did see old ones on accessing the ports that I already know that's why I specified my exact problem

  9. #9
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    did you see userport??
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Gee, a whole page of unformatted whining.....
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FTP program
    By jakemott in forum Linux Programming
    Replies: 14
    Last Post: 10-06-2008, 01:58 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM
  4. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM
  5. reading the parrallel port ?
    By samhail in forum C Programming
    Replies: 3
    Last Post: 01-29-2002, 09:32 AM