RS232 Software Handshaking: xon/xoff / ext/ack

RS232 Software Handshaking: xon/xoff / ext/ack

The most common method of handshaking that is used with RS2332 is to employ the hard wired option. However it is also possible to use software codes embedded within the data, thereby saving the use of the additional lines required for hardware handshaking.

The RS232 software handshaking option is particularly useful for applications where data needs to be sent over telephone lines. Here it is possible to control the data flow simply using the data only and this makes it possible to send data without he need for the additional lines.

There may also be instances where it is more convenient to use software methods to effect the handshaking.

When implementing RS232 software handshaking two of the commonly used methods are XON/XOFF and EXT/ACK.


The X-ON X-OFF operates by sending the control characters along the data line from the equipment receiving the data. The "X" in the name means "transmitter," so XON and XOFF are commands for switching a transmitter on or off, respectively.

When X-ON is received at the transmitting end data transmission is started.

Once the input buffer on the terminal or printer starts to become full the X-OFF character is sent to stop the data. When sufficient space appears in the buffer X-ON can be sent to the transmitter to resume the data flow.

The actual character or signal for XON is the same bit configuration as the ASCII Ctrl-Q keyboard combination. The XOFF character or signal is the Ctrl-S character.


A second method is called EXT/ACK. Using this method the data is separated into blocks and after each block has been sent the control code ETX is transmitted to show the end of this block of text.

Once the data has been accepted and there is sufficient space in the input buffer the ACK or acknowledgement control code is sent. Once this has been received, the next block of data is sent.

Other codes

Other codes are also used within what is effectively software control of an RS232 communications link. These codes are used for a variety of purposes from indicating tabs, form feeds as well as providing audible 'bell' warnings.

These codes are naturally focussed on some of the older teletypes that used two wire RS232 links.

Control Codes Names

RS232 Control Codes
Code NameFunction
NULNull (blank)
SOHStart of header
STXStart of text
ETXEnd of text
EOTEnd of transmission
BELBell (Audible)
HTHorizontal tab
LFLine feed
VTVertical tab
FFForm feed
CRCarriage return
SOShift out
SIShift in
DLEData link escape
DC1Device control 1
DC2Device control 2
DC3Device control 3
DC4Device control 4
NAKNegative acknowledgement
SYNSynchronous idle
ETBEnd of transmission block
EMEnd of medium
FSFile separator
GSGroup separator
RSRecord separator
USUnit separator

Although not all of the codes are used these days because many are intended for use by the older teletype equipments, the same processes are valid for modern equipment. This set of codes are known as control codes, which even gives rise to the 'CTRL' key on today's keyboards. Additionally the idea of software handshaking, although it was not so widely used in the early days, is now well established and usually the preferred method of implementing control of communications systems in view of the flexibility offered by processors.

Wireless & Wired Connectivity Topics:
Mobile Communications basics2G GSM3G UMTS4G LTE5GWiFiIEEE 802.15.4DECT cordless phonesNFC- Near Field CommunicationNetworking fundamentalsWhat is the CloudEthernetSerial dataUSBSigFoxLoRaVoIPSDNNFVSD-WAN
Return to Wireless & Wired Connectivity

Watch the video: Transfer files from PC to Amiga using a gotek drive and ADF disk images (November 2020).