RS232 Debug Cheat Sheet
How to decode an RS232 bitstream with an oscilloscope
The basic principles are:
- Data bits are inverted, i.e.
- -12V means 1/high
- +12V means 0/low
- Bits within a byte are transmitted MSB first, LSB last
- Each byte starts with a high start bit
- Each byte ends with 0-2 low stop bits (when stop bits are enabled)
- When idle, the line is low.
This bitstream represents the byte F4h, using 8N1 (8 bits/character,
No parity bit, and 1 stop bit.)
RS232 pinouts
This diagram is also available as a PDF file
DCE stands for Data Communications Equipment.
Usually this implies a modem, but for simple stuff,
this usually translates to "anything that plugs into a PC."
DTE stands for Data Terminal Equipment, which is usually a PC.
All signals are shown on the diagrams above; however if hardware handshaking
isn't being used, only three signals need to be connected: RXD, TXD, and GND. To
connect a DCE to a DTE device, simply wire
- RXD to TXD
- TXD to RXD
- GND to GND
To connect two PCs (DTEs) or two DCEs together, a null modem must be used. In
the simple case above, all that's required is to swap the location of RXD and TXD
on one end of the cable.
Signal Definitions
The signals are described in terms of a PC (DTE) and a modem (DCE.) As
mentioned before, in the simple case an embedded system will only use RXD, TXD,
and GND, unless hardware handshaking is used.
- Transmit Data - PC's serial data output stream to modem
- Receive Data - PC's serial data input stream from modem
- GND - Signal ground
- Carrier Detect - tells PC that modem has good remote connection
- Clear To Send - modem is ready to receive data from PC
- Data Set Ready - tells PC that modem is ready
- Data Terminal Ready - tells modem that PC is ready
- Request To Send - tells modem PC wants to send data
- Ring Indicator - modem detected a ringing signal
');
document.write('');
// document.write('');
document.write('');
document.write('');
if (document.cookie.indexOf('fcseenpop') == -1) {
pop_domain = document.domain.substring(document.domain.indexOf('.'));
expiry_date = new Date(new Date().getTime() + 86400000).toGMTString(); // 24 hours
document.write('');
document.cookie = 'fcseenpop=1; path=/; domain=' + pop_domain + '; expires=' + expiry_date;
}
}
}
// -->