locked
Programming the parallel port help!!! RRS feed

  • Question

  •  

    Hello:

     

    I'm looking for projects about programming the parallel port. I found an excellent article at CodeProject.com about leds titled "

    I/O Ports Uncensored - 1 - Controlling LEDs (Light Emiting Diodes) with Parallel Port" (http://www.codeproject.com/csharp/csppleds.asp).
    It´s very useful because I´m studying Computer Architecture in my University. But now, I want to see another projects. I found on Internet projects based on C, but I want projects based on .NET.
     
    Can you help me? (Excuse me if I must post this message in another forum)
     
    Thanks.
    Friday, September 21, 2007 11:39 PM

Answers

  • Programming parallel ports is very easy and you can still use the code you've already got. Years ago when I first got started in PC based robots, all of mine used to be parallel controlled.

    It used to be a whole lot easier because before Windows XP people were able to program parallel and other I/O ports by simply writing data bytes to certain memory locations such 0x0278 or 0x03BC etc.
    With XP they changed it so that you couldnt directly control hardware with your code. Somebody was clever enough to write a dll and library to getaround this problem in XP and 2000 and all of the other NT based operating systems. This is the inpout32 dll you will have already seen if you used that code. It dosent matter that it was written in C because if you use interop in your .Net code you can still use the functions. You might need to typecast some of the data types but you will almost certainly be able to use the code.

    All you have to do is link that dll into your program.

    The problems you will come across using the parallel port in a real robot are that in certain parallel port modes you only have 5input bits to work with so if you want a byte of input, you will have to add your own electronics to give you thsoe extra bits. The two real problems of the parallel port though are that the timing is going to have to be strictly controlled by your program and if you just plug straight into the bus, the data dosent travel very well over long distances. If you care about electrical noise and EMC, parallel is about the worst kind of bus to use.

    Saturday, September 22, 2007 12:31 PM