Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Serial port
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Flow control=== [[Flow control (data)|Flow control]] is used in circumstances where a transmitter might be able to send data faster than the receiver is able to process it. To cope with this, serial lines often incorporate a [[Handshake (computing)|handshaking]] method. There are ''hardware'' and ''software'' handshaking methods. '''Hardware handshaking''' is done with extra signals, often the RS-232 RTS/CTS or DTR/DSR signal circuits. RTS and CTS are used to control data flow, signaling, for instance, when a buffer is almost full. Per the RS-232 standard and its successors, DTR and DSR are used to signal that equipment is present and powered up so are usually asserted at all times. However, non-standard implementations exist, for example, printers that use DTR as flow control. '''Software handshaking''' is done for example with [[ASCII]] control characters [[XON/XOFF]] to control the flow of data. The XON and XOFF characters are sent by the receiver to the sender to control when the sender will send data, that is, these characters go in the opposite direction to the data being sent. The system starts in the ''sending allowed'' state. When the receiver's buffers approach capacity, the receiver sends the XOFF character to tell the sender to stop sending data. Later, after the receiver has emptied its buffers, it sends an XON character to tell the sender to resume transmission. It is an example of [[in-band signaling]], where control information is sent over the same channel as its data. The advantage of hardware handshaking is that it can be extremely fast, it works independently of imposed meaning such as ASCII on the transferred data and it is [[state (computer science)|stateless]]. Its disadvantage is that it requires more hardware and cabling, and both ends of the connection must support the hardware handshaking protocol used. The advantage of software handshaking is that it can be done with absent or incompatible hardware handshaking circuits and cabling. The disadvantage, common to all in-band control signaling, is that it introduces complexities in ensuring that control messages get through even when data messages are blocked, and data can never be mistaken for control signals. The former is normally dealt with by the operating system or device driver; the latter normally by ensuring that control codes are [[escape sequence|escaped]] (such as in the [[Kermit protocol]]) or omitted by design (such as in [[ANSI escape code|ANSI terminal control]]). If '''no handshaking''' is employed, an overrun receiver might simply fail to receive data from the transmitter. Approaches for preventing this include reducing the speed of the connection so that the receiver can always keep up, increasing the size of [[data buffer|buffers]] so it can keep up averaged over a longer time, using delays after time-consuming operations (e.g. in [[termcap]]) or employing a mechanism to resend data which has not been received correctly (e.g. [[Transmission Control Protocol|TCP]]).
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)