Thread: How to read/write to parallel port?

  1. #1
    Registered User
    Join Date
    Dec 2003
    Posts
    10

    Question How to read/write to parallel port?

    How can I read and write bits to the parallel port?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    You need to specify your OS.
    You need to specify your compiler.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Dec 2003
    Posts
    10
    GCC on linux.

  4. #4
    Registered User
    Join Date
    Dec 2003
    Posts
    10
    I need to read 4 bits in parallel using the parallel port, how can I do this? I'm using GCC on Linux.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    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.

  6. #6
    Griffmaster
    Join Date
    Feb 2005
    Location
    Glasgow, Scotland, UK
    Posts
    3
    what about using windows 95/98 and MS visual studio 6? any tips or links?

  7. #7
    the lowly newb
    Join Date
    Jan 2005
    Location
    IL
    Posts
    49
    or useing windows with dec-cpp?
    "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life."

    "They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."

    "Light thinks it travels faster than anything but it is wrong. No matter how fast light travels, it finds the darkness has always got there first, and is waiting for it."
    [all]- Terry Pratchett

  8. #8
    Registered User
    Join Date
    Aug 2004
    Posts
    4
    Using Turbo C compiler you can access the parallel port, It is possible for windows 98,I am not sure about 95.

    Function name Outportb(0x378,"data");

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    14
    I think that you can access things on a hardware level in and of the 9x operating systems including Me and also possible in NT, but in the 2000 release I think you were blocked out as a “security feature” the same is true for XP and 2003. As an aside the parallel port is a relay poor option for PC interfacing (that’s why its being phased out).
    Currently Reading:

    Mathematic from the birth of numbers,
    Effective TCP/IP programming,
    Data Compression: The Complete Reference,
    C Interfaces and Implementations: Techniques for Creating Reusable Software,
    An Introduction to Genetic Algorithms for Scientists and Engineers.

  10. #10
    Registered User
    Join Date
    Dec 2003
    Posts
    10
    I read the parallel port stuff on the websites above. There was only one link to the Linux programming that I found and it was on redhat.com. http://people.redhat.com/twaugh/parp...portguide.html

    There is a problem though, i'm using a different kind of linux and I do not have the /dev/parport0 in my devices, all I see is /dev/lp0

    What do I do?
    All I want to do is to write 1 byte of data and read 1 byte of data. has anyone done this before? I want to do this so when I write hex 01 to the port the first pin will get a high voltage on it and in a separate program I try to read the port for the pins that are tied high (resembling 1's).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port IO ops not working properly
    By microtechno in forum Linux Programming
    Replies: 16
    Last Post: 06-08-2009, 12:33 PM
  2. Parallel Port to USB controller and outb()
    By coletek in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2009, 06:57 AM
  3. Replies: 3
    Last Post: 02-29-2008, 01:29 PM
  4. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  5. Segmentation Fault - Trying to access parallel port
    By tvsinesperanto in forum C Programming
    Replies: 3
    Last Post: 05-24-2006, 03:28 AM