![]() |
||||
Serial Port Basics (continued)HandshakingA handshaking signal from the receiving device tells the transmitter "I am ready for data" or "I am not ready for data." These signals are optional: the receiver may always be ready for data or may choose to simply discard data it couldn't process. RTS and CTS are the most common handshake signals. A DTE device asserts the "request to send" (RTS) signal when it is ready to receive data and deasserts it when it cannot accept data. Likewise, a DCE device asserts "clear to send" (CTS) when it is ready to receive data. The RTS and CTS signals form a handshaking pair, and their use constitutes RTS/CTS handshaking. The "data terminal ready" (DTR) signal, asserted by the DTE, and the "data set ready" (DSR) signal, asserted by the DCE, serve similar functions and constitute DTR/DSR handshaking. A DTE or DCE devices may employ either or both forms of handshaking. Often, deasserting RTS or CTS signals "micro" events, such as a buffer that is full but will be empty soon, while deasserting DTR or DSR may signal "major" events such as that power has not been applied. RTS/CTS handshaking and DTR/DSR handshaking are both referred to as hardware handshaking. Another form of handshaking, XON/XOFF or software handshaking, requires that the receiver send a character (Control-S, ASCII 19) to halt data transfer and another character (Control-Q, ASCII 17) to resume transfer. Although this method eliminates the need for the RTS, CTS, DTR, or DSR signals, it suffers from slow response time by the receiver and renders 2 characters of the 256-character ASCII set unusable. At data transfer rates above 9600 bps, it is important to employ handshaking wherever possible even when UARTs with FIFO buffers are used. Remember that at 115200 bps, a 16-byte FIFO fills in only 1.3 milliseconds, while many mass storage devices advertise average seek times of 20-30 milliseconds. |
||||
|
Email comments
|
Copyright © 2000-2006 Acumen Instruments Corporation |
|||