Java Parallel Port Programming with the Java Communications API

Discussion in 'Java' started by Paul Perrone, Aug 21, 2003.

  1. Paul Perrone

    Paul Perrone Guest

    I've read some messages on here regarding the Java Communications API
    and the problems some have had with writing to parallel ports. I also
    was puzzled by why I couldn't get this to work and then finally
    figured out something that worked for me so am sharing this.

    First of all, I am using Linux, downloaded the RXTX software,
    downloaded the Sun x86/Solaris drivers for the Comm API (yes you need
    this even for Windows/Linux), and installed per the instructions.
    There were a few snags but the instructions contain much of what you
    need to get past these.

    The main problem I had was with properly wiring the cable from the
    parallel port to drive my external circuits. You definately need some
    sort of buffer chips to provide the interface from/to the parallel
    port and your external devices (i.e. motors, LEDs, etc) and of course
    power that circuit with an external 5V supply. That wasn't the problem
    for me though. I had my data lines from the parallel port connected to
    drive the external device...but it wasn't working with the Java
    Communications API.

    After some more tinkering, the trick was to tie the parallel port
    status lines 10 & 11 (Ack and Busy) to low/ground and lines 12, 13, &
    15 (paper out, select, & error) to high/5V. This should be done
    through the output of a buffer chip though. I also tied lines 18-25 to
    low/ground.

    With that, the Java Communications API worked like a charm. The OS and
    driver software must cleary require that the status input lines be
    broadcasting signals that indicate the external device is OK...and by
    tying the status lines mentioned to the proper signal levels...it
    looks as if the external device is OK (i.e. no errors, not busy, has
    paper, etc).

    Previously, I had the status lines all tied to ground or had them
    floating. After looking at a parallel port spec, I figured out what
    the status lines are signalling to the system.

    I hope this helps some of you trying to do something similar.

    Regards,

    Paul

    /******************************************************************/
    Paul J. Perrone
    Assured Technologies, Inc.
    Web: www.assuredtech.com
    Author of various books on J2EE, Java, XML, and Web
    Services: http://www.assuredtech.com/books_page.htm
    Recently completed project includes the
    "J2EE Developer's Handbook" geared for J2EE v1.4.
    /******************************************************************/
    Paul Perrone, Aug 21, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karthik
    Replies:
    5
    Views:
    10,972
    Dale King
    Jul 25, 2003
  2. Dmitry
    Replies:
    2
    Views:
    548
    Dale King
    Feb 12, 2004
  3. Replies:
    4
    Views:
    600
    Jon A. Cruz
    Mar 6, 2004
  4. b3ny
    Replies:
    11
    Views:
    907
    Babu Kalakrishnan
    Nov 20, 2004
  5. Soren
    Replies:
    4
    Views:
    1,236
    c d saunter
    Feb 14, 2008
Loading...

Share This Page