Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RS-232 /RS-485 disconnection detection

Status
Not open for further replies.

DNA2683

Advanced Member level 4
Joined
Sep 3, 2012
Messages
106
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,290
hi

i need some help with RS-232 /RS-485 disconnection detection .

i want to recognize if someone is disconnect the RS-232/RS-485 cable between my device to the "client"

i tried to find some software solutions but i didn't find any ...so now im looking for an hardware solution.

i have a processor with a free GPIOs so maybe if someone can help my with a way to get an "interrupt" or something that will detect if someone disconnect the RS-232/RS-485 cable between my device to the "client".

thanks for the help
 

Hi,

With RS232 you have several data lines, not only RxD and TxD. Usually there is a line where you can detect a disconnection.
Is it DTR?

Software: The simplest solution is to frequently send data. Like the Ethernet "ping". If no response, then it is disconnected.

Klaus
 

RS-232 can use handshake signals to detect presence/disconnection of the peer. There's no similar option for RS-485, you need to monitor connection state on the protocol level (which would be also the safer way for RS-232, because it can detect software induced connection loss).
 

Hi,

With RS232 you have several data lines, not only RxD and TxD. Usually there is a line where you can detect a disconnection.
Is it DTR?

Software: The simplest solution is to frequently send data. Like the Ethernet "ping". If no response, then it is disconnected.

Klaus

not all devices use all the control signals so i need to find a solution for this case . :)

- - - Updated - - -

RS-232 can use handshake signals to detect presence/disconnection of the peer. There's no similar option for RS-485, you need to monitor connection state on the protocol level (which would be also the safer way for RS-232, because it can detect software induced connection loss).


how can i do that? can you please give me an explanation ?

thanks :)
 

not all devices use all the control signals so i need to find a solution for this case . :)
Refers to the vagueness of your original question. Which hardware features are available on each side?

In case you want the solution to work for RS-485, the answer has been clearly given. Why not use the same approach for RS-232, too?
 

Refers to the vagueness of your original question. Which hardware features are available on each side?

In case you want the solution to work for RS-485, the answer has been clearly given. Why not use the same approach for RS-232, too?

hi

Unfortunately I can not change the frequency that i send data.(system issue)
i have 2 devices that connect with 3 wires TXD, RXD ,GND . my device send each 10 seconds data to the other device and the other device gives an answer to my device.
i want the that ill have the ability to detect if someone disconnect the cable from my device or form the other device ( i mean disconnect the cable between the 10 seconds communication window).

thanks

thanks.
 

Supposed it's a standard RS-232 driver, you can monitor the negative line level in idle state.
 

Monitor Rx line with a comparator, threshold could be e.g. -2V.
 

Monitor Rx line with a comparator, threshold could be e.g. -2V.

thanks for the help , can you please give me more details ?

you say that i need to use a comparator. so one of the comparator leg (such as V+) ill connect to the RX...and what ill need to connect to the V- leg ( compere the RX to what? ...i know when there is no data transition on the line the voltage is 0V)..

thanks for the help
 

i know when there is no data transition on the line the voltage is 0V
Not true. Check with your MAX3232 or a PC RS-232 interface.
 
i want to recognize if someone is disconnect the RS-232

At the hardware side, considering the the volatage levels ranging from -2v to +2v are not allowed on this electrical standard, you could use this fact to create an circuit that monitors that.

At the software side, if some flow control pins are not being used, you could connect them through a loopback circuit ( input/output ), in order to detect the presence of the device connected.
 
Hi,

FvM recommends to compare Rx to -2V..

and what ill need to connect to the V- leg ( compere the RX to what? .
-->
* In+ to Rx
* In- to -2V

Comparaot output: 1 = idle or transmitting "high"; 0 = disconnected or transmitting "low"

UART communication is idle high. With RS232 high means a signal voltage below -2V.
The comparator output shows when there is no "high" --> RS232 not idle. Either transmitting a "Low" or disconnected. Your software shoud have timeout to decide if it is disconnected or transmitting.


Klaus
 
loss of signal (LOS ) functionality is accomplished by designing the Rx so that the minimum input high level is slightly negative (-10mV to -25mV), rather than the +200mV used for standard RS-485 and RS-422 Rx.

Then have the server use a parallel chip to detect the disconnect or short to 0V across the line.

- - - Updated - - -

https://www.intersil.com/content/dam/Intersil/documents/an15/an1593.pdf

- - - Updated - - -

Hi,

FvM recommends to compare Rx to -2V..


-->
* In+ to Rx
* In- to -2V

Comparaot output: 1 = idle or transmitting "high"; 0 = disconnected or transmitting "low"

UART communication is idle high. With RS232 high means a signal voltage below -2V.
The comparator output shows when there is no "high" --> RS232 not idle. Either transmitting a "Low" or disconnected. Your software shoud have timeout to decide if it is disconnected or transmitting.


Klaus


Actually RS-232 threshold is similar to TTL around 1.3 to 1.5V
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top