Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Java Parallel Port Programming with the Java Communications API

Reply
Thread Tools

Java Parallel Port Programming with the Java Communications API

 
 
Paul Perrone
Guest
Posts: n/a
 
      08-21-2003
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.
/************************************************** ****************/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble developing API for easy parallel/multithreaded programming k04jg02@gmail.com C++ 2 02-18-2008 09:52 PM
Parallel port control with USB->Parallel converter Soren Python 4 02-14-2008 03:18 PM
use com port as parallel port b3ny Java 11 11-20-2004 06:50 AM
Java Communications API, help to start! Dmitry Java 2 02-12-2004 03:54 AM
Parallel port programming in Java karthik Java 5 07-25-2003 05:22 AM



Advertisments