RS-232 DB9 pinout diagram @ pinoutguide.com (2024)

This RS232C DE-9 (usually miscalled DB-9) port is available in some PCs and many other devices. An RS-232 serial port was once a standard feature of a personal computer, used for connections to modems, printers, mice, data storage, uninterruptible power supplies, and other peripheral devices.

RS-232, is astandardintroduced in 1960forserial communicationtransmission of data. It formally defines the signals connecting between aDTE(data terminal equipment) such as acomputer terminal, and aDCE(data communication equipment), such as amodem. The RS-232 standard had been commonly used incomputerserial ports. The standard defines the electrical characteristics and timing of signals, the meaning of signals, and the physical size andpinoutof connectors.PC serial port is based on RS-232 standard, you may find signals details in the RS-232 interface pinout.

RS-232, when compared to later interfaces such asRS-422,RS-485andEthernet, has lower transmission speed, short maximum cable length, large voltage swing, large standard connectors, no multipoint capability and limited multidrop capability. In modern personal computers,USBhas displaced RS-232 from most of its peripheral interface roles. Many computers no longer come equipped with RS-232 ports (although somemotherboardscome equipped with a COM port header that allows the user to install a bracket with a DE-9 port) and must use either an external USB-to-RS-232 converter or an internal expansion card with one or more serial ports to connect to RS-232 peripherals. Nevertheless, thanks to their simplicity and past ubiquity, RS-232 interfaces are still used — particularly in industrial machines, networking equipment, and scientific instruments where a short-range, point-to-point, low-speed wired data connection is adequate.

This PC serial port interface is single ended (interconnect two devices only, via RS232 serial cable), the data rate is less than 20 kbps. RS232 is the voltage loop serial interface with full-duplex communication represented by voltage levels with respect to system ground. A common ground between the PC and the associated device is necessary. Hot-plug isn't supported, but sometimes allowed. Nowdays only 9-pin connector is still in use for PCs.

DE-9 PinSignal NameDirDescription
1DCDRS-232 DB9 pinout diagram @ pinoutguide.com (1)Data Carrier Detect
2RXDRS-232 DB9 pinout diagram @ pinoutguide.com (2)Receive Data
3TXDRS-232 DB9 pinout diagram @ pinoutguide.com (3)Transmit Data
4DTRRS-232 DB9 pinout diagram @ pinoutguide.com (4)Data Terminal Ready
50V/COMRS-232 DB9 pinout diagram @ pinoutguide.com (5)0V or System Ground
6DSRRS-232 DB9 pinout diagram @ pinoutguide.com (6)Data Set Ready
7RTSRS-232 DB9 pinout diagram @ pinoutguide.com (7)Request to Send
8CTSRS-232 DB9 pinout diagram @ pinoutguide.com (8)Clear to Send
9RIRS-232 DB9 pinout diagram @ pinoutguide.com (9)Ring Indicator

Note: Direction is DTE (Computer) relative DCE (Modem)

Standard RS232 data packet

RS232 datais usually sent as a packet with 7 or 8 bit words, start, stop, parity bits (may be varied). Sample transmission shown on picture: Start bit (active low, usually between +3v and +15v) followed by data bits, parity bit (depends on protocol used) and finished by stop bit (used to bring logic high, usually between -3v and -15v).

Sample RS232 serial port device. How serial mouse works

Typical PC mouse controlling system has the following parts: sensors -> mouse controller -> communication link -> data interface -> driver -> software. Sensors are the movement detectors which sense the mouse movement and button swiches which sense the button states. Mouse controller reads the state of those sensors and takes acount of current mouse position. When this information changes the mouse controller sends a packet of data to the computer serial data interface controller. The mouse driver in the computer received that data packet and decodes the information from it and does actions based on the information.

PC RS232 serial mouse voltage levels:

Mouse takes standard RS-232C output signals (+-12V) as its input signals. Those outputs are in +12V when mouse is operated. Mouse takes some current from each of the RS-232C port output lines it is connected (about 10mA). Mouse send data to computer in levels that RS-232C receiver chip in the computer can uderstand as RS-232C input levels. Mouse outputs are normally something like +-5V, 0..5V or sometimes +-12V. Mouse electronics normally use +5V voltage.


Serial device hardware implementation

PC serial mouse uses typically DTR and RTS lines for generating +5V power for microcontroller circuit in the mouse. Because typical optomechanical mouse also needs power for 4 leds in the optocoupler movevement detectors, there is not much power to loose. A typical approach is to use diodes to take current from DTR and RTS lines and then feed it through resistor to all of the (infrared) leds in the movement detectors. The positive power supply usually taken from RTS and DTR lines (just after the diodes and before the resistor going to leds). The negative supply for transmitter is taken from TD pin. Typical PC serial port mouse takes 10 mA total current and operates at voltage range of 6-15V. The data itself in sent using standard asynchronous RS-232C serial format:

 Start D0 D1 D2 D3 D4 D5 D6 D7 Stop Logic 0 ___ ___ ___ ___ ___ ___ ___ ___ ___ +3..+15V | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Logic 1 | | | | | | | | | | -3..-15V ___| |___|___|___|___|___|___|___|___|____

Serial mouse pinout explanation

PinSignalDescription
shellProtective Ground
3TDSerial data from host to mouse (only for power)
2RDSerial data from mouse to host
7RTSPositive voltage to mouse
8CTS
6DSR
5Signal Ground
4DTRPositive voltage to mouse and reset/detection

RTS = Request to Send CTS = Clear to Send DSR = Data Set Ready DTR = Data Terminal Ready

When DTR line is toggled, mouse should send one data byte containing letter M (ascii 77) to identify itself. To function correctly, both the RTS and DTR lines must be positive. The lines DTR-DSR and RTS-CTS must NOT be shorted. Implement the RTS toggle function by setting the RTS line negative and positive again. The negative pulse width is at least 100ms. After a cold boot, the RTS line is usually set to a negative level. In this case, setting the RTS line to a positive level is also considered an RTS toggle.

RS232 serial data parameters and packet format

1200bps, 7 databits, 1 stop-bit

Data packet is 3 byte packet. It is send to the computer every time mouse state changes (mouse moves or keys are pressed/released).

 D7 D6 D5 D4 D3 D2 D1 D0 1. X 1 LB RB Y7 Y6 X7 X62. X 0 X5 X4 X3 X2 X1 X0 3. X 0 Y5 Y4 Y3 Y2 Y1 Y0

Note: The bit marked with X is 0 if the mouse received with 7 databits and 2 stop bits format. It is also possible to use 8 databits and 1 stop bit format for receiving. In this case X gets value 1. The safest thing to get everything working is to use 7 databits and 1 stopbit when receiving mouse information (and if you are making mouse then send out 7 databits and 2 stop bits).

The byte marked with 1. is send first, then the others. The bit D6 in the first byte is used for syncronizing the software to mouse packets if it goes out of sync.

LB is the state of the left button (1 means pressed down); RB is the state of the right button (1 means pressed down); X7-X0 movement in X direction since last packet (signed byte); Y7-Y0 movement in Y direction since last packet (signed byte)

RS-232 DB9 pinout diagram @ pinoutguide.com (2024)
Top Articles
Latest Posts
Article information

Author: Rev. Porsche Oberbrunner

Last Updated:

Views: 6062

Rating: 4.2 / 5 (73 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Rev. Porsche Oberbrunner

Birthday: 1994-06-25

Address: Suite 153 582 Lubowitz Walks, Port Alfredoborough, IN 72879-2838

Phone: +128413562823324

Job: IT Strategist

Hobby: Video gaming, Basketball, Web surfing, Book restoration, Jogging, Shooting, Fishing

Introduction: My name is Rev. Porsche Oberbrunner, I am a zany, graceful, talented, witty, determined, shiny, enchanting person who loves writing and wants to share my knowledge and understanding with you.