views:

620

answers:

8

In all honesty, I think the answer is "no;" however, I want to get a second opinion. Basically, I need one micro-controller device to send a steady signal to another one, but the communicate between them is using RS232. So I think that I have to create/update the communication messages to get it to do what I want.

What do you think?

+7  A: 

You should be able to set something like DTR (Data Terminal Ready), pin 20, or DSR (Data Set Ready), pin 6, high and keep it there as your steady-state signal. This is how modems/terminals detect that there is a device on the other end that is ready to communicate. It all depends on what level of access you have to the hardware through your driver.

[EDIT] This doesn't involve sending data, although you could still do that using TX/RX, pins 2 & 3.

RS-232 Reference on wikipedia

tvanfosson
A: 

It might be possible to do something like that, provided you don't mind a burst-like interface. One micro could transmit a byte and the other could do something to that byte and send it back as a response.

Nate
A: 

If you can control both ends of the line, you may be able to turn the rs-232 tx and rx lines into regular logic lines to give that information.

In most situations, however, each end periodically sends a byte of status information that contains 8 possible digital values - gives much more status information.

A timer on the receiving end is reset everytime a message is received, and if the timer times out then the message has taken too long and yo can act on missing status message.

As others have pointed out, if you're using hardware flow control you have some status lines available as well, though in many cases those lines aren't implemented so that may not be an option.

Adam Davis
A: 

Steady signal could mean:

  • steady burst of charaters: keep the send buffer full
  • line held high or low : send nothing or send continual breaks
jyoung
A: 

I think it depends to a large extent on the UART that you are using, e.g. link text, and the level of access you have to it under software. If you check the data sheet there are often ways of controlling most of the pins directly for testing purposes, but you will need to go at it from a pretty low level.

At a higher level, tvanfosson's answer is pretty much the way i'd do it.

Shane MacLaughlin
A: 

If the question is "can I alter the DC state of the Tx line", then the answer is that many uarts (including the ones in PCs) can be asked to create a 'break' condition, which is the opposite to the normal idle condition of the line.

So you can turn 'break' on and off and toggle the line like that.

Will Dean
A: 

While the first answer is correct it may not be possible to use this technique (using DTR or DSR) on many micro controllers as they may not have those signals (many micro controllers may just have the basic RX/TX lines and you would often have to use other i/o ports if you wanted extra control/status lines. However, all is not lost, many RS232 controllers allow you to set the TX line to 'mark' or 'space' (i.e set the TX line to logic high or low). This would allow you to get your steady state signal. The RX line on the receiver can be checked to see if its at mark or space level.

Tim Ring
+3  A: 

You mean a fixed voltage? Not a square wave? (the letter U) What about a break command (if you want to call it a command)?

Certainly you can use one of the control lines if that helps...Or are you specifically looking for something out of the TX?

dwelch
Upvoted for "U".
Toybuilder
U is for Upvote.
Piskvor