Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Serial port
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Hardware== {{More citations needed section|date=November 2021}} Modern devices use an [[integrated circuit]] called a [[UART]] to implement a serial port. This IC converts characters to and from [[asynchronous serial]] form, implementing the timing and framing of data specified by the serial protocol in hardware. The IBM PC implements its serial ports, when present, with one or more UARTs. Very low-cost systems, such as some early [[home computer]]s, would instead use the [[CPU]] to send the data through an [[input/output|output]] pin, using the [[bit banging]] technique. These early home computers often had proprietary serial ports with pinouts and voltage levels incompatible with RS-232. Before [[large-scale integration]] (LSI) made UARTs common, serial ports were commonly used in [[mainframe]]s and [[minicomputer]]s, which would have multiple small-scale integrated circuits to implement shift registers, logic gates, counters, and all the other logic needed. As PCs evolved serial ports were included in the [[Super I/O]] chip and then in the [[chipset]]. {{Gallery | IBM PC Serial Card.jpg | An [[IBM PC]] serial card with a 25-pin connector (obsolete 8-bit [[Industry Standard Architecture|ISA]] card) | RS232 PCI-E.jpg | A [[PCI Express]] ×1 card with one serial port | Four-port serial card with an octopus cable.jpg | A four-port serial (RS-232) PCI Express ×1 [[expansion card]] with an [[octopus cable]] that breaks the card's DC-37 connector into four standard DE-9 connectors | FTDI USB SERIAL.jpg | A converter from USB to an RS-232 compatible serial port—more than a physical transition, it requires a driver in the host system software and a built-in processor to emulate the functions of the [[IBM XT]] compatible serial port hardware. |UART to USB adapter.jpg|UART to USB adapter }} ===DTE and DCE=== The individual signals on a serial port are unidirectional and when connecting two devices, the outputs of one device must be connected to the inputs of the other. Devices are divided into two categories: ''[[data terminal equipment]]'' (DTE) and ''[[data circuit-terminating equipment]]'' (DCE). A line that is an output on a DTE device is an input on a DCE device and vice versa, so a DCE device can be connected to a DTE device with a straight wired cable, in which each pin on one end goes to the same numbered pin on the other end. Conventionally, computers and terminals are DTE, while peripherals such as [[modem]]s are DCE. If it is necessary to connect two DTE (or DCE) devices together, a cable with reversed TX and RX lines, known as a [[Crossover cable|cross-over]], roll-over or [[null modem]] cable must be used. ===Gender=== Generally, serial port connectors are [[Gender of connectors and fasteners|gendered]], only allowing connectors to mate with a connector of the opposite gender. With [[D-subminiature]] connectors, the male connectors have protruding pins and female connectors have corresponding round sockets.<ref>{{cite web |url=http://www.cisco.com/c/en/us/support/docs/routers/7200-series-routers/12219-17.html |title=Serial Cable Connection Guide |date=2006-08-01 |publisher=CISCO |access-date=2016-01-31}}</ref> Either type of connector can be mounted on equipment or a panel; or terminate a cable. Connectors mounted on DTE are likely to be male, and those mounted on DCE are likely to be female (with the cable connectors being the opposite). However, this is far from universal; for instance, most serial printers have a female DB25 connector, but they are DTEs.<ref>{{cite web |url=http://ltxfaq.custhelp.com/app/answers/detail/a_id/1216/~/rs232---dte-and-dce-connectors |title=RS232 - DTE and DCE connectors |date=2006-03-29 |publisher=Lantronix |access-date=2016-01-31 |archive-url=https://web.archive.org/web/20151214054632/http://ltxfaq.custhelp.com/app/answers/detail/a_id/1216/~/rs232---dte-and-dce-connectors |archive-date=2015-12-14 |url-status=dead }}</ref> In this circumstance, the appropriately gendered connectors on the cable or a [[gender changer]] can be used to correct the mismatch. ===Connectors=== The only connector specified in the original RS-232 standard was the 25-pin D-subminiature, however, many other connectors have been used to save money or save on physical space, among other reasons. In particular, since many devices do not use all of the 20 signals that are defined by the standard, connectors with fewer pins are often used. While specific examples follow, countless other connectors have been used for RS-232 connections. The 9-pin [[D-subminiature|DE-9]] connector has been used by most IBM-compatible PCs since the Serial/Parallel Adapter option for the [[IBM Personal Computer/AT|PC-AT]], where the 9-pin connector allowed a serial and parallel port to fit on the same card.<ref>{{Cite web|title=IBM PC AT Serial/Parallel Adapter|url=http://www.minuszerodegrees.net/oa/OA%20-%20IBM%20PC%20AT%20Serial_Parallel%20Adapter.pdf|url-status=dead|archive-url=https://web.archive.org/web/20200224102106/http://minuszerodegrees.net/oa/OA%20-%20IBM%20PC%20AT%20Serial_Parallel%20Adapter.pdf|archive-date=2020-02-24}}</ref> This connector has been standardized for RS-232 as [[TIA-574]]. Some miniaturized electronics, particularly [[graphing calculator]]s<ref>{{Cite web|title=TI-73...92+/V200 TI Link Guide|url=http://merthsoft.com/linkguide/cable.html|access-date=2020-08-14|website=merthsoft.com}}</ref> and hand-held [[Amateur radio|amateur]] and [[two-way radio]] equipment,<ref>{{Cite web|title=Technical Section |url=https://www.miklor.com/COM/UV_Technical.php#progcable|access-date=2020-08-14|website=Miklor.com}}</ref> have serial ports using a [[phone connector (audio)|phone connector]], usually the smaller 2.5 or 3.5 mm connectors and the most basic 3-wire interface—transmit, receive and ground. [[8P8C]] connectors are also used in many devices. The [[EIA/TIA-561]] standard defines a pinout using this connector, while the [[rollover cable]] (or Yost standard) is commonly used on [[Unix]] computers and network devices, such as equipment from [[Cisco Systems]].<ref>{{Cite web|title=Cabling Guide for Console and AUX Ports|url=https://www.cisco.com/c/en/us/support/docs/routers/7000-series-routers/12223-14.html|access-date=2020-08-14|website=Cisco }}</ref> Many models of [[Macintosh]] favor the related RS-422 standard, mostly using circular [[mini-DIN connector]]s. The Macintosh included a standard set of two ports for connection to a printer and a modem, but some [[PowerBook]] laptops had only one combined port to save space.<ref>{{Cite web |title=Classic Mac Ports |url=https://whitefiles.org/tec/pgs/h10b.htm |access-date=2020-08-14 |website=WhiteFiles.org }}</ref> [[10P10C]] connectors can be found on some devices.<ref name="National Instruments 2013">{{cite web |url=http://www.ni.com/pdf/manuals/371253e.pdf |publisher=National Instruments |title=Serial Quick Reference Guide |website=NI.com |date=July 2013 |access-date=2021-06-18 }}</ref> Another common connector is a {{resx|10|2}} [[pin header]] common on motherboards and add-in cards which is usually converted via a [[ribbon cable]] to the more standard 9-pin DE-9 connector (and frequently mounted on a free slot plate or other part of the housing).<ref>{{Cite book |url=https://www.intel.com/content/dam/support/us/en/documents/motherboards/server/s5000pal/sb/s5000pal_s5000xal_tps_r2_0.pdf |title=Intel Server Board S5000PAL/S5000XAL Technical Product Specification |pages=38 }}</ref> {{Gallery | CiscoConsoleCable.jpg | A Cisco rollover cable using the 8P8C Yost standard. | Mac lc printer modem ports.jpg|Pair of female [[Mini DIN-8]] connectors used for [[RS-422]] serial ports on a [[Macintosh LC]] computer. | CAN Connecteur.svg|Pin numbering looking into a<br/>male [[D-subminiature|DE-9]] connector. | DE-9 Female.svg|Pin numbering looking into a<br/>female DE-9 connector. }} ===Pinouts=== The following table lists commonly used RS-232 signals and pin assignments:<ref>{{cite web |url=http://www.hardwarebook.info/Serial_(PC_9) |title=Serial (PC 9) |author-first=Joakim |author-last=Ögren |access-date=2010-07-07 |archive-url=https://web.archive.org/web/20100811173526/http://www.hardwarebook.info/Serial_%28PC_9%29 |archive-date=2010-08-11 }}</ref> {| class="wikitable sortable" style="margin:auto; text-align:center;" ! colspan="3"|Signal !! colspan="2"|Direction !! colspan="11"|Connector pin |- ! rowspan="2"|Name !! rowspan="2"|[[ITU-T V.24|V.24]] circuit !! rowspan="2"|Abbreviation !! rowspan="2"|[[Data terminal equipment|DTE]] !! rowspan="2"|[[Data circuit-terminating equipment|DCE]] !! rowspan="2"|[[DB-25]] !! rowspan="2"|{{nowrap|[[DE-9]]}} {{nowrap|([[TIA-574]])}} !! rowspan="2"|[[Modified Modular Jack|MMJ]] !! colspan="5"|[[8P8C]] ("RJ45") !! colspan="3"|[[10P10C]] ("RJ50") |- ! [[EIA/TIA-561]] !! Yost (DTE)<ref name="Yost">{{cite web |url=http://yost.com/computers/RJ45-serial/ |title=Yost Serial Device Wiring Standard |access-date=2020-05-10 |archive-url=https://web.archive.org/web/20200617132523/http://yost.com/computers/RJ45-serial/ |archive-date=2020-06-17 |url-status=dead }}</ref> !! Yost (DCE)<ref name="Yost"/> !! Cyclades !! [[Digi International|Digi]] (ALTPIN option) !! [[National Instruments]]<ref name="National Instruments 2013">{{cite web |url=http://www.ni.com/pdf/manuals/371253e.pdf |publisher=National Instruments |title=Serial Quick Reference Guide |website=NI.com |date=July 2013 |access-date=2021-06-18 }}</ref> !! Cyclades !! Digi |- | Transmitted Data || 103 || TxD | Out || In || 2 || 3 || 2 || 6 || 6 || 3 || 3 || 4 || 8 || 4 || 5 |- | Received Data || 104 || RxD | In || Out || 3 || 2 || 5 || 5 || 3 || 6 || 6 || 5 || 9 || 7 || 6 |- | Data Terminal Ready || 108/2 || DTR | Out || In || 20 || 4 || 1 || 3 || 7 || 2 || 2 || 8 || 7 || 3 || 9 |- | Data Carrier Detect || 109 || DCD | In || Out || 8 || 1 || {{n/a}} || 2 || rowspan="2"|2 || 7 || 7 || 1 || 10 || 8 || 10 |- | Data Set Ready || 107 || DSR | In || Out || 6 || 6 || 6 || rowspan="2"|1 || {{n/a}} || 8 || {{n/a}} || 5 || 9 || 2 |- | Ring Indicator || 125 || RI | In || Out || 22 || 9 || {{n/a}} || {{n/a}} || {{n/a}} || {{n/a}} || {{n/a}} || 2 || 10 || 1 |- | Request To Send || 105 || RTS | Out || In || 4 || 7 || {{n/a}} || 8 || 8 || 1 || 1 || 2 || 4 || 2 || 3 |- | Clear To Send || 106 || CTS | In || Out || 5 || 8 || {{n/a}} || 7 || 1 || 8 || 5 || 7 || 3 || 6 || 8 |- | Signal Ground || 102 || G | colspan="2" | Common || 7 || 5 || 3, 4 || 4 || 4, 5 || 4, 5 || 4 || 6 || 6 || 5 || 7 |- | Protective Ground || 101 || PG | colspan="2" | Common || 1 || {{n/a}} || {{n/a}} || {{n/a}} || {{n/a}} || {{n/a}} || {{n/a}} || 3 || {{n/a}} || 1 || 4 |} ''Signal Ground'' is a [[Single-ended signaling|common return]] for the other connections; it appears on two pins in the Yost standard but is the same signal. The DB-25 connector includes a second ''Protective Ground'' on pin 1, which is intended to be connected by each device to its own frame ground or similar. Connecting Protective Ground to Signal Ground is a common practice but not recommended. Note that EIA/TIA 561 combines DSR and RI,<ref>{{cite web| url = http://www.hardwarebook.info/RS-232D| title = Hardware Book RS-232D}}</ref><ref>{{cite web| url = http://www.t0rchthe.net/rj45console/index.html| title = RS-232D EIA/TIA-561 RJ45 Pinout}}</ref> and the Yost standard combines DSR and DCD. ===Hardware abstraction=== Operating systems usually create symbolic names for the serial ports of a computer, rather than requiring programs to refer to them by hardware address. [[Unix-like]] operating systems usually label the serial port devices {{mono|/dev/tty*}}. ''TTY'' is a common trademark-free abbreviation for ''[[teletype]]'', a device commonly attached to early computers' serial ports, and {{mono|*}} represents a string identifying the specific port; the syntax of that string depends on the operating system and the device. On [[Linux]], [[8250]]/[[16550 UART]] hardware serial ports are named {{mono|/dev/ttyS*}}, USB adapters appear as {{mono|/dev/ttyUSB*}} and various types of virtual serial ports do not necessarily have names starting with {{mono|tty}}. The [[DOS]] and [[Windows]] environments refer to serial ports as [[COM (hardware interface)|COM]] ports: COM1, COM2,..etc.<ref>{{cite news |title=What Is a Com1 Port? |url=https://www.techwalla.com/articles/what-is-a-com1-port |author=Stephen Byron Cooper |newspaper=Techwalla |access-date=2021-09-30}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)