Serial port handshake. What the difference between Hardware and None handshaking?
Asked Answered
S

2

6

I'm trying to determine the difference when I open serial port with hardware handshake and none handshake.

It seems that in both cases I have to control RTS/CTS signals (just tested it with one COM device). So what the difference between opening serial port with hardware handshake and without handshaking?

From my previous understanding, when we work without handshaking, we don't care about RTS/CTS and DTR/DSR signals. Just send and receive data whenever we want. Was I wrong?

One more question. Can we work without handshaking in full duplex mode only?

Schoenberg answered 28/9, 2011 at 5:42 Comment(0)
U
7

As you probably know, the issue is "flow control". Like the Clash song "Should I stay or should I go?".

RTS/CTS is hardware control. XON/XOFF is software control. Otherwise, "just keep going".

This link might explain further:

http://www.lammertbies.nl/comm/info/RS-232_flow_control.html

I suspect that when you were asking about "handshaking" with respect to "duplex", perhaps you meant this:

http://en.wikipedia.org/wiki/RS-232

In older versions of the specification, RS-232's use of the RTS and CTS lines is asymmetric: The DTE asserts RTS to indicate a desire to transmit to the DCE, and the DCE asserts CTS in response to grant permission. This allows for half-duplex modems that disable their transmitters when not required, and must transmit a synchronization preamble to the receiver when they are re-enabled.

'Hope that helps!

Unfaithful answered 28/9, 2011 at 5:46 Comment(2)
Thanks @paulsm4. But I'm trying to find the difference in terms of operating by RTS/CTS signals: - Should I set/check RTS/CTS signals if I open serial port without flow control? Should I do these things manually if I open serial port with hardware flow control? - Can I set RTS to High after opening the port and don't touch it after that? Is it good practice? - In half duplex mode how can I change CTS signal to prevent data receiving? It seems I can set RTS and DTR signals and just check CTS and DSR signals.Schoenberg
@Unfaithful It's been 10 years but this link is really useful. Thanks! I'm currently implementing this dinosaur technologyCleric
A
1

The difference is more about whether the kernel will pay attention to the CTS/RTS lines when deciding whether to send more data or not. With hardware handshaking turned on, it will. With it set to none, it won't, even though the CTS/RTS lines may stay asserted, so that the peer will know it can send data.

Allocation answered 23/12, 2013 at 18:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.