detecting when RS-232 comm has been established?

I have a project where I am using the arduino to communicate via serial communications with a separate device (a motorola cpu with a MAX232IN). The arduino can be wired in directly to the rx/tx pins of the motorola, or it could be run through the RS232 serial port.

The trick is that I need the arduino to share this serial port with a laptop, so that when the laptop plugs in to the motorola, the arduino will stop communicating.

I have no control over the communications protocol, and I see no way to analyze the traffic.

My plan is to run one of the pins from the MAX232IN to an analog input on the arduino. I noticed that pin 13 (R1IN) goes from -6.6v to 0v when the laptop is plugged in. But, of course, the analog inputs on the arduino can only handle 0-5v, which would mean I'd need to invert the signal and add a voltage divider, which I don't really have room for.

Do any of the other pins have a measurable change in voltage when serial comm is established? Any other ideas on how to do this?


which would mean I'd need to invert the signal and add a voltage divider

No, have a voltage divider pulling down, if you get the values right it will never go below 0V, with -6 on it and with 0V on it you would read high. You could also put catcher diodes on if for protection if it did do negative.

Ah yes, that would be simpler. Thanks for the advice. Wouldn't I use a pullup though? Wouldn't a pulldown just pull it up to 0v?

Is this what you had in mind?

What I was meaning was that your external voltage would be pulling down the the voltage on the analogue input.

That circuit is similar but the diode should not be a zenner just a normal one.