Link to home
Start Free TrialLog in
Avatar of RivKin
RivKin

asked on

Serial (rs232) general information


Say I would like to turn on and off, an electrical device using rs-232 (mscomm control).


I now I need some sort of an electrical converter that will trigger something when I send a signal.


How do I now what to send?
how mach Voltage do I send Via my Serial port?

Am I even asking the right questions? :()
Avatar of RivKin
RivKin

ASKER

Ok after doing some reading I will simplify my question:

I need to activate a circuit using a single pin.

So which pin should I use, and what is the voltage spec. of it?

Thanks you.
Avatar of GrahamSkan
I think your remote device needs to have an RS232 interface. RS232 signals are 5V.
Tx data is probably the best line to use.
Avatar of RivKin

ASKER

what do i need to send?

it's doesnt have to be a protocol, jest a voltage change from a single pin.

Oh. That's pin 2 on a 25 pin D plug, but pin 3 on a 9 pin plug.
It's not supposed to work that way, but if you send a continuous stream of &Hff bytes (in 8 bit, no parity), it might hold the line up enough to keep the switch on.
If you just need a voltage change, then sending anyhing with odd parity will toggle the line a few times.
Avatar of RivKin

ASKER

what do you mean : "continuous stream of &Hff bytes " ?
The rs232 port was not designed to be used in the way you suggest.  

You don't specify a voltage level to be sent.  You specify what data is to be transmitted and the serial port sends the data via pulses of 1's and 0's, which are actually high/low voltage levels synchronized (hopefully) with the timing signals.

Your device would also need an rs232 interface to intercept the signals and act accordingly.  If it doesn't have one, you could build one using some kind of basic stamp with a rs232 interface.  You would have to write the program and flash it over to the chip.  You would decide what signal to use to trigger your voltage driver.  You would essentially be creating your own mscomm control on the basic chip.

I'm no engineer so I can't help you with that part.

Do a google search for "rs232 interface uart basic stamp driver" and you should get tons of resources.

You should be able to buy most parts from your local radio shack. =)

Idle_Mind
ASKER CERTIFIED SOLUTION
Avatar of bingie
bingie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>Your device would also need an rs232 interface to intercept the signals and act accordingly.  If it doesn't have one, you could build one using some kind of basic stamp with a rs232 interface.  You would have to write the program and flash it over to the chip.  You would decide what signal to use to trigger your voltage driver.  You would essentially be creating your own mscomm control on the basic chip.<<

True, and thats more trouble than it's worth. You can simply chop the end off your parallel port cable, connect a wire to an led and run my code above and the LED will light.

It's that simple.
You have definitely have more experience than than I bingie. ;-)

I have only used devices that already have rs232 interfaces and done some basic pinout rewiring with a breakout box.

Idle_Mind
Avatar of RivKin

ASKER


bingie => "That last command will set the DO line high"

What pin is it on the lpt port?

Avatar of RivKin

ASKER

pin 2?
Avatar of RivKin

ASKER

can you tell me the Voltage, resistance, current specifications?
Ok - One at a time...

See here for a Parallel Port Pinout

http://www.diyha.co.uk/electronics/parallel.html
http://www.infonewsindia.com/pinout/ibmlpt.txt

As you said, DO is Pin 2. Since it's "active low", you can send a zero to it and it will turn high. You can actually control each of those pins. You can also read from a selected pin, to get the status of your device, for example.

If you use the buffer as mentioned, your port will deliver 5V high and 0V low. The current being is dependant on the resistance of the load and is calculated from ohms law. If you are driving a 500 Ohm system, the current produce will be:

I = V/R
  = 5V / 5000 Ohms
  = 1 mA

Of course, the max current you can draw will be euqal to the max provided by the port. I believe this is around 2.4 mA, based on the port and buffers max current rating. If you use a buffer with ahigher current rating, you will be limited by the lesser of the two.

2.4 mA is more than enough because you can always connect it to a simple current amplifier or use it to drive a relay.

Here is another good site on the parallel port:

http://www.lvr.com/parport.htm
It is possible to do the intended control with the serial port: instead of sending data via the TxD pin simply operate one of the two additional output signals of the serial port: the RTS pin or the DTR pin.
NB: Signals on the serial port have a voltage swing between (nominally) -12V and +12V wrt.  ground; the outputs are short circuit proof within a.m. margins.