Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > use com port as parallel port

Reply
Thread Tools

use com port as parallel port

 
 
b3ny
Guest
Posts: n/a
 
      11-16-2004
hello everybody, short question
is it possible to use the serial com port with the comm api as
parallel port
and check every single input channel (if it is high)??

i'am trying to create a extern media controller, that has buttons for
play, stop, next,volume up... and i want to keep everything
simple(without parallel/seriell converter)...

thanx 4 help beny
 
Reply With Quote
 
 
 
 
Graeme Hill
Guest
Posts: n/a
 
      11-16-2004
I think you have the wrong end of the stick here.

Com ports are serial devices i.e. one bit at a time, one after the other.
You would needs some extra electronics to interface what you describe to a
serial port - parallel and serial ports are electronically and
theoretically different in design and practice.

If you did want to interface such a controller to a serial port, you would
need to conver the switch activations to a serial byte of information
that could pass back to the serial port.

On 15 Nov 2004, b3ny wrote:

> hello everybody, short question
> is it possible to use the serial com port with the comm api as
> parallel port
> and check every single input channel (if it is high)??
>
> i'am trying to create a extern media controller, that has buttons for
> play, stop, next,volume up... and i want to keep everything
> simple(without parallel/seriell converter)...
>
> thanx 4 help beny
>


 
Reply With Quote
 
 
 
 
b3ny
Guest
Posts: n/a
 
      11-16-2004
> I think you have the wrong end of the stick here.

i knew thus... but the serial port has more than one in/output channels...
RxD and TxD are the two data channels, but whats up with the status bits??
DCD DSR RTS CTS and DTR can't i use them as normal in/outputs???

beny
 
Reply With Quote
 
Oscar kind
Guest
Posts: n/a
 
      11-16-2004
b3ny <(E-Mail Removed)> wrote:
>> I think you have the wrong end of the stick here.

>
> i knew thus... but the serial port has more than one in/output channels...
> RxD and TxD are the two data channels, but whats up with the status bits??
> DCD DSR RTS CTS and DTR can't i use them as normal in/outputs???


No. These bits are used by the serial port controller (i.e. the hardware)
to control when to send bits over the communication wires. After all, the
buffers on both sides must not overflow.

Even though the software can tell the controller which handshaking
protocol to use (i.e. the pins or using special bit patterns on the
communication line), the controller is in charge. Not the software.


--
Oscar Kind http://home.hccnet.nl/okind/
Software Developer for contact information, see website

PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2
 
Reply With Quote
 
Knute Johnson
Guest
Posts: n/a
 
      11-16-2004
b3ny wrote:
>>I think you have the wrong end of the stick here.

>
>
> i knew thus... but the serial port has more than one in/output channels...
> RxD and TxD are the two data channels, but whats up with the status bits??
> DCD DSR RTS CTS and DTR can't i use them as normal in/outputs???
>
> beny


yes you can!

--

Knute Johnson
email s/nospam/knute/
 
Reply With Quote
 
Babu Kalakrishnan
Guest
Posts: n/a
 
      11-17-2004
Oscar kind wrote:
> b3ny <(E-Mail Removed)> wrote:
>
>>>I think you have the wrong end of the stick here.

>>
>>i knew thus... but the serial port has more than one in/output channels...
>>RxD and TxD are the two data channels, but whats up with the status bits??
>>DCD DSR RTS CTS and DTR can't i use them as normal in/outputs???

>
>
> No. These bits are used by the serial port controller (i.e. the hardware)
> to control when to send bits over the communication wires. After all, the
> buffers on both sides must not overflow.
>
> Even though the software can tell the controller which handshaking
> protocol to use (i.e. the pins or using special bit patterns on the
> communication line), the controller is in charge. Not the software.
>


That isn't quite right - at least for the 16450/16550 compatible serial
ports that are used in the IBM PC architecture. Flow control must always
be performed by software - (The nomenclature "Hardware" vs. "Software"
flow control only differentiates between whether the signalling of these
states is done through the hardware pins RTS/CTS or as part of the data
stream - XON/XOFF)

So while you cannot control the state of the TxD pin (or read that of
the RxD pin) programmatically, all the remaining pins (DTR and RTS as
outputs and DSR,CTS,DCD and RI as inputs) can be controlled / read
asynchronously from the PC.

 
Reply With Quote
 
b3ny
Guest
Posts: n/a
 
      11-19-2004
> So while you cannot control the state of the TxD pin (or read that of
> the RxD pin) programmatically, all the remaining pins (DTR and RTS as
> outputs and DSR,CTS,DCD and RI as inputs) can be controlled / read
> asynchronously from the PC.


tell me how it works???
how di i have to config the comm api?
maybe a little source code example?

thanx beny
 
Reply With Quote
 
Babu Kalakrishnan
Guest
Posts: n/a
 
      11-19-2004
b3ny wrote:
>>So while you cannot control the state of the TxD pin (or read that of
>>the RxD pin) programmatically, all the remaining pins (DTR and RTS as
>>outputs and DSR,CTS,DCD and RI as inputs) can be controlled / read
>>asynchronously from the PC.

>
>
> tell me how it works???
> how di i have to config the comm api?
> maybe a little source code example?
>


Check out the API for the javax.comm.SerialPort class. You have the
setDTR(), setRTS() methods to set the output bits and the
isDSR(),isCTS(), isCD(), isRI() methods for reading the bits.

BK
 
Reply With Quote
 
Graeme Hill
Guest
Posts: n/a
 
      11-19-2004
Please remember that according to the RS232 specification, a 1 (high bit)
is a NEGATIVE voltage with respect to ground - between perhaps -5 and -15
volts. A 0 (low bit) is POSITIVE with respect to ground, again e.g. +5 to
+15 volts.

Paralell ports, on the other end, will typically operate at TTL voltages
e.g. 0 V is 0(low) bit, +5V is 1(high) bit.

If you don't know what you doing, you will almost certainly fry your RS232
port.


More info e.g. http://www.sangoma.com/signal.htm

On Fri, 19 Nov 2004, Babu Kalakrishnan wrote:

> b3ny wrote:
> >>So while you cannot control the state of the TxD pin (or read that of
> >>the RxD pin) programmatically, all the remaining pins (DTR and RTS as
> >>outputs and DSR,CTS,DCD and RI as inputs) can be controlled / read
> >>asynchronously from the PC.

> >
> >
> > tell me how it works???
> > how di i have to config the comm api?
> > maybe a little source code example?
> >

>
> Check out the API for the javax.comm.SerialPort class. You have the
> setDTR(), setRTS() methods to set the output bits and the
> isDSR(),isCTS(), isCD(), isRI() methods for reading the bits.
>
> BK
>


 
Reply With Quote
 
steve
Guest
Posts: n/a
 
      11-20-2004
On Sat, 20 Nov 2004 01:48:05 +0800, Graeme Hill wrote
(in article
<(E-Mail Removed)>):

> Please remember that according to the RS232 specification, a 1 (high bit)
> is a NEGATIVE voltage with respect to ground - between perhaps -5 and -15
> volts. A 0 (low bit) is POSITIVE with respect to ground, again e.g. +5 to
> +15 volts.
>
> Paralell ports, on the other end, will typically operate at TTL voltages
> e.g. 0 V is 0(low) bit, +5V is 1(high) bit.
>
> If you don't know what you doing, you will almost certainly fry your RS232
> port.
>
>
> More info e.g. http://www.sangoma.com/signal.htm
>
> On Fri, 19 Nov 2004, Babu Kalakrishnan wrote:
>
>> b3ny wrote:
>>>> So while you cannot control the state of the TxD pin (or read that of
>>>> the RxD pin) programmatically, all the remaining pins (DTR and RTS as
>>>> outputs and DSR,CTS,DCD and RI as inputs) can be controlled / read
>>>> asynchronously from the PC.
>>>
>>>
>>> tell me how it works???
>>> how di i have to config the comm api?
>>> maybe a little source code example?
>>>

>>
>> Check out the API for the javax.comm.SerialPort class. You have the
>> setDTR(), setRTS() methods to set the output bits and the
>> isDSR(),isCTS(), isCD(), isRI() methods for reading the bits.
>>
>> BK
>>

>


there is not enough wires, to cover all his options , unless he implements
some external logic.

he has a number of options.

1. give up
2. use the parallel port.
3. use the usb port with a couple of extra chips.
4. if he insists on using the serial port, he just needs a parallel to serial
convertor chip.
then feed his signals into the parallel side.
he can use the chip to handle the RS232 interface

Then use 2 other control lines 1 to reset the chip & 1 to act as a clock. (
unless the chip implements it own internal clock)

first step , each time he wants to read.
1. issue a reset signal to the external chip ( puts the parallel chip in
exactly a known state)
2. issue a clock signal to clock the data out, until 1 byte received.
allow the api to assemble the byte.
3. read byte , decode bits.
go to 1.

he does not even need a voltage convertor. to get his +- supply. if he is
smart he can leach off the RS232 port. ( set 1 line high , & 1 line low then
use that to power the chip & circuit ( cmos))









 
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
Re: Parallel in, Parallel out shift register Vivek Menon VHDL 0 06-10-2011 10:15 PM
Parallel in, Parallel out shift register Vivek Menon VHDL 5 06-08-2011 03:56 PM
Parallel port control with USB->Parallel converter Soren Python 4 02-14-2008 03:18 PM
New Computer Can't Use Parallel Port Dongle from Legacy Software Edge Computer Information 3 08-11-2006 07:40 PM
How To Build Parallel Port Prototypes Silverstrand Front Page News 1 10-14-2005 05:33 AM



Advertisments