Monday, October 15, 2007

RS-232 Flow Control Primer

Hardware flow control uses pins RTS and CTS to gate flow back and forth between two connected serial devices. The DTE device uses RTS to start and stop flow from the DCE device, and the DCE device uses CTS to gate flow from the DTE device. This method is popular for higher speed connections where flow control reaction time is more critical. It's also popular where the data stream is such that embedded flow control characters can not be tolerated by the protocol running on the link. The cost is that you have to run two more wires in the cable.

Software flow control uses special START (XON) and STOP (XOFF) characters embedded in the data stream to gate flow. In other words, the receiving device would send a STOP character (typically a control-s) to the sending device to halt flow. It would then later send a START character (typically a control-q) to resume flow. This method of flow control is more popular for slower links whose protocol can support embedded flow control characters. It's popular because it only requires that you run 3 wires for the link to function: Receive (RxD), Transmit (TxD), and Ground (GND).

No comments: