rs_232 - dwilson2547/wiki_demo GitHub Wiki
RS-232 (Recommended Standard 232) is a standard for serial communication, widely used for connecting data terminal equipment (DTE) and data communication equipment (DCE). It defines the electrical characteristics, timing, and physical connectors for data exchange between devices.
- Asynchronous Communication: Data is transmitted without a clock signal, using start/stop bits.
- Full-Duplex: Supports simultaneous two-way communication.
- Point-to-Point: Typically connects two devices directly.
-
Voltage Levels:
- Logic 1 (Mark): -3V to -25V
- Logic 0 (Space): +3V to +25V
- Distance: Up to 15 meters (50 feet) at standard baud rates.
-
DB-9 (9-pin) and DB-25 (25-pin) are the most common connectors.
-
Only a few pins are essential for basic communication:
Pin DB-9 DB-25 Signal Name Description 2 3 2 TXD Transmit Data 3 2 3 RXD Receive Data 5 7 7 GND Signal Ground 7 4 20 DTR Data Terminal Ready 8 5 6 DSR Data Set Ready
- Baud Rate: Common rates include 9600, 19200, 38400, 57600, and 115200 bps.
- Data Bits: Typically 7 or 8 bits per character.
- Parity: Optional (None, Even, Odd).
- Stop Bits: 1 or 2 bits to signal the end of a character.
- Start Bit: Indicates the beginning of a character (logic 0).
- Data Bits: 5-8 bits representing the character.
- Parity Bit: Optional error-checking bit.
- Stop Bit: Signals the end of a character (logic 1).
- Legacy Devices: Printers, modems, and industrial equipment.
- Embedded Systems: Debugging and configuration.
- Telecommunications: Routers, switches, and serial consoles.
- Simple and widely supported.
- Low cost and easy to implement.
- Limited distance and speed.
- No built-in error correction.
- Susceptible to electrical noise.
- Check Connections: Ensure TX/RX pins are correctly connected.
- Baud Rate Mismatch: Verify both devices use the same baud rate.
- Voltage Levels: Use a multimeter to confirm signal levels.
- Loopback Test: Connect TX to RX on the same device to test functionality.
- USB: Replaced RS-232 in most consumer applications.
- Ethernet: Used for high-speed, long-distance communication.
- Wireless: Bluetooth and Wi-Fi for cable-free solutions.
DB-9 Pin (Device A) | DB-9 Pin (Device B) |
---|---|
2 (TXD) | 3 (RXD) |
3 (RXD) | 2 (TXD) |
5 (GND) | 5 (GND) |