Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4384
  • Last Modified:

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? :()
0
RivKin
Asked:
RivKin
  • 6
  • 4
  • 3
  • +2
1 Solution
 
RivKinAuthor Commented:
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.
0
 
GrahamSkanCommented:
I think your remote device needs to have an RS232 interface. RS232 signals are 5V.
Tx data is probably the best line to use.
0
 
RivKinAuthor Commented:
what do i need to send?

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

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
GrahamSkanCommented:
Oh. That's pin 2 on a 25 pin D plug, but pin 3 on a 9 pin plug.
0
 
GrahamSkanCommented:
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.
0
 
GrahamSkanCommented:
If you just need a voltage change, then sending anyhing with odd parity will toggle the line a few times.
0
 
RivKinAuthor Commented:
what do you mean : "continuous stream of &Hff bytes " ?
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
0
 
bingieCommented:
The serial port sends data down a single wire in "Packets". This "packet" of data consists of a start bit, data bits, parity bit and stop bit(s). The data is sent at a rate known as the Baud Rate. The serial port is configured so that all these parameters as specified. It is normally configured like 9600,2,E for 9600 baud rate, 2 stop bits and even parity.

So if you wanted to send data that is 8 bits long and is equal to 11111111 then the data stream could be all ones, except for the start bit, stop and parity bits. But once this stream is sent, its done. That is why you need to continually send the bytes. This can be done in a loop.

A good tutorial on RS232 can be found here:

http://www.arcelect.com/rs232.htm

Have you considered using the parallel port? You can actually set one of the pins high and leave it high. It will remain high and you will not need to set this in a loop.

When using the serial port, you need to set the port to the required specs and sometime set it for handshaking signals. This can result in more code.

You can use a free third party device to communicate with the parallel port. I use one called NTPORT and is available from here:

http://www.uct.on.ca/

With the parallel port, it requires 3 commands:

NTPORT1.address = 888   'address for data lines
NTPORT1.bitsize = 8         'Set the byte size
NTPORT1.value = 1           'activate D0 line...output in decimal

That last command will set the DO line high.


So if you need to activate your circuit using a single pin, IMHO the parallel port is the way to go. I have used both extensivly and the parallel port can be up and running in 5 mins.

Note: You will need to be an administrator on the account to run NTPORT on your PC.

Also, remember to use a buffer on the port to prevent damage to the port. A simple tri-state buffer will prevent damage to the port and provide you will true logic levels, since the port can be off.

You can purchase a buffer from mouser: http://www.mouser.com


Bingie
0
 
bingieCommented:
>>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.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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
0
 
RivKinAuthor Commented:

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

What pin is it on the lpt port?

0
 
RivKinAuthor Commented:
pin 2?
0
 
RivKinAuthor Commented:
can you tell me the Voltage, resistance, current specifications?
0
 
bingieCommented:
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
0
 
scolopenderCommented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 6
  • 4
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now