Subject: Converted serial port primer
To: None <netbsd-docs@netbsd.org>
From: None <dsieger@techfak.uni-bielefeld.de>
List: netbsd-docs
Date: 04/04/2007 22:43:49
--eHhjakXzOLJAF9wJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi,
attached is a converted htdocs/Documentation/Hardware/Misc/serial.list
and according patch.
Regards,
Daniel
--
Daniel Sieger
Faculty of Technology
Bielefeld University
wwwhomes.uni-bielefeld.de/dsieger
--eHhjakXzOLJAF9wJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="serial.xml"
<?xml version="1.0"?>
<!DOCTYPE webpage
PUBLIC "-//NetBSD//DTD Website-based NetBSD Extension//EN"
"http://www.NetBSD.org/XML/htdocs/lang/share/xml/website-netbsd.dtd">
<webpage id="Documentation-hardware-misc-serial">
<config param="desc" value="Hardware Documentation: &os; Serial Port Primer"/>
<config param="cvstag" value="$NetBSD: $"/>
<config param="rcsdate" value="$Date: $"/>
<head>
<!-- Copyright (c) 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED. -->
<title>Hardware Documentation: &os; Serial Port Primer</title>
</head>
<sect1 role="toc">
<sect2 id="serial_port">
<title>&os; Serial Port Primer</title>
<!-- TODO:
sgimips cables?
get someone to write the device name to /dev name lookup -->
<sect3 id="general_info">
<title>General Information</title>
<para>This document is intended as a supplement to the
documentation that came with your hardware. It briefly
outlines some of the issues related to connecting the serial
ports of some of the supported platforms. Many of the
supported platforms require or optionally allow use of a
serial console, and some confusion may arise over how to
wire the connectors.</para>
<para>Briefly, most computers are DTE (Data Terminal
Equipment), and most modems and dumb terminals are DCE (Data
Communication Equipment). To connect a DTE to a DTE (such
as to use a PC as a PPP server or a terminal), you need to
insert a <quote>null modem</quote> cable, which swaps the
transmit and receive data and handshaking lines.</para>
<para>There are various handshaking, or <quote>modem</quote>
lines that are specified in the serial protocols. These
allow DTE and DCE equipment to pace the flow of information
(such as if the receiving equipment isn't ready to get more
data, it tells the transmitting equipment to wait until it's
ready). For a more detailed and accurate description, you
should read one of the references above.</para>
<para>See your port's FAQ, or a hardware reference to
determine how to enable serial console on your hardware
(if supported). On many platforms, you only need to
remove the keyboard and mouse. On others, you need to
remove the framebuffer. On yet others, you need to set up
the bootrom or PROM to explicitly use a serial console.
The most common setting is 9600 bps, 8 bits, no parity,
and one stop bit. Handshaking requirements vary from
platform to platform.</para>
<para>Keep in mind, that if your system's bootROM, Firmware,
or whatever supports serial consoles, NetBSD is smart
enough to know about this. That means, you most likely
should <emphasis>not</emphasis> enable a separate
&man.ttys.5; in <filename>/etc/ttys</filename>. You may,
however, need to edit the console entry to ensure that it
has the correct terminal type (for example, change
'<code>sun</code>' to '<code>vt100</code>').</para>
<para>On some platforms, a constant stream of zeros is
equivalent to a serial <code>BREAK</code>. For example,
on sparc systems, this tells the system to drop into the
bootrom prompt. Keep this in mind if you find out that
disconnecting a serial cable causes your system to stop
responding.</para>
</sect3>
<sect3 id="connectors">
<title>Connector types and pinouts</title>
<para>There are three common connector types: DB25, DB9, and
MiniDIN8. The pin
numbering convention is as follows (female connectors are
reversed):</para>
<para>MiniDIN8 (male)</para>
<screen> 8 7 6
5 4 3
2 1</screen>
<para>DB25 (male)</para>
<screen> 1 13
_______________________________
\ . . . . . . . . . . . . . /
\ . . . . . . . . . . . . /
---------------------------
14 25</screen>
<para>DB9 (male)</para>
<screen> 1 5
_______________
\ . . . . . /
\ . . . . /
-----------
6 9</screen>
<para>RJ-11 (male)</para>
<screen> _!=!_
| | | |
-------
1 2 3 4</screen>
</sect3>
<sect3 id="pinouts">
<title>Serial port pinouts for various platforms</title>
<para>Unfortunately, not everyone follows a standard set of
pin numbers for their serial lines. In particular, the
vendors using MiniDIN8 connectors screw everything up. If
you're willing to do without the handshaking lines, any
MiniDIN8 cable should work on any system (i.e. TxD, RxD, and
GND are all in the same location). Be wary of Macintosh
<quote>modem</quote> cables, as some vendors wire them
differently (trying to allow for DTR, DSR, and DCD
signaling) -- you should check their wiring with a
multimeter before making any assumptions.</para>
<table id="pinouts_table" border="2">
<tr>
<th align="left">signal name</th>
<th align="right">standard DB9</th>
<th align="right">standard DB25</th>
<th align="right"><ulink url="#mac">mac</ulink> MiniDIN8</th>
<th align="right"><ulink url="#next68k">next68k</ulink> MiniDIN8</th>
<th align="right"><ulink url="../../../Ports/sgimips/">sgi</ulink> MiniDIN8</th>
<th align="right"><ulink url="#sparc">sparc</ulink> MiniDIN8</th>
<th align="right"><ulink url="#hp300">hp300</ulink> DB9</th>
<th align="right">dir</th>
<th align="left">full name</th>
<th align="left">comment</th>
</tr>
<tr>
<td align="left">TxD</td>
<td align="right">3</td>
<td align="right">2</td>
<td align="right">3</td>
<td align="right">3</td>
<td align="right">3</td>
<td align="right">3</td>
<td align="right">2</td>
<td align="right">out</td>
<td align="left">Transmit Data</td>
<td align="left">data</td>
</tr>
<tr>
<td align="left">RxD</td>
<td align="right">2</td>
<td align="right">3</td>
<td align="right">5</td>
<td align="right">5</td>
<td align="right">5</td>
<td align="right">5</td>
<td align="right">3</td>
<td align="right">in</td>
<td align="left">Receive Data</td>
<td align="left">data</td>
</tr>
<tr>
<td align="left">RTS</td>
<td align="right">7</td>
<td align="right">4</td>
<td align="right">-</td>
<td align="right">6</td>
<td align="right">6</td>
<td align="right">6</td>
<td align="right">4</td>
<td align="right">out</td>
<td align="left">Request To Send</td>
<td align="left">handshake</td>
</tr>
<tr>
<td align="left">CTS</td>
<td align="right">8</td>
<td align="right">5</td>
<td align="right">-</td>
<td align="right">8</td>
<td align="right">2</td>
<td align="right">2</td>
<td align="right">5</td>
<td align="right">in</td>
<td align="left">Clear To Send</td>
<td align="left">handshake</td>
</tr>
<tr>
<td align="left">DTR</td>
<td align="right">4</td>
<td align="right">20</td>
<td align="right">-</td>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">1</td>
<td align="right">out</td>
<td align="left">Data Terminal Ready</td>
<td align="left">status</td>
</tr>
<tr>
<td align="left">DSR</td>
<td align="right">6</td>
<td align="right">6</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">6</td>
<td align="right">in</td>
<td align="left">Data Set Ready</td>
<td align="left">status</td>
</tr>
<tr>
<td align="left">RI</td>
<td align="right">9</td>
<td align="right">22</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">9</td>
<td align="right">in</td>
<td align="left">Ring Indicator</td>
<td align="left">status</td>
</tr>
<tr>
<td align="left">DCD</td>
<td align="right">1</td>
<td align="right">8</td>
<td align="right">-</td>
<td align="right">2</td>
<td align="right">7</td>
<td align="right">7</td>
<td align="right">8</td>
<td align="right">in</td>
<td align="left">Data Carrier Detect</td>
<td align="left">status</td>
</tr>
<tr>
<td align="left">RTxC</td>
<td align="right">-</td>
<td align="right">17</td>
<td align="right">-</td>
<td align="right">7</td>
<td align="right">-</td>
<td align="right">8</td>
<td align="right">-</td>
<td align="right">in</td>
<td align="left">Receive Clock</td>
</tr>
<tr>
<td align="left">HSKo</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">1</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">out</td>
<td align="left">Output Handshake</td>
<td align="left">mac-specific (usually RTS)</td>
</tr>
<tr>
<td align="left">HSKi</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">2</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">in</td>
<td align="left">Input Handshake</td>
<td align="left">mac-specific (usually CTS)</td>
</tr>
<tr>
<td align="left">TxD+</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">6</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">out</td>
<td align="left">RS-422 Transmit Data (+)</td>
</tr>
<tr>
<td align="left">RxD+</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">8</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">in</td>
<td align="left">RS-422 Receive Data (+)</td>
</tr>
<tr>
<td align="left">GPi</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">7</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">in</td>
<td align="left">General Purpose Input may be used for RI or
handshaking</td>
</tr>
<tr>
<td align="left">GND</td>
<td align="right">5</td>
<td align="right">7</td>
<td align="right">4</td>
<td align="right">4</td>
<td align="right">4,8</td>
<td align="right">4</td>
<td align="right">7</td>
<td align="right">n/a</td>
<td align="left">Signal Ground</td>
<td align="left"></td>
</tr>
<tr>
<td align="left">-</td>
<td align="right">-</td>
<td align="right">1</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">-</td>
<td align="right">n/a</td>
<td align="left">Protective Ground</td>
<td align="left">cable shield (do not use for Signal
Ground)</td>
</tr>
</table>
<para id="mac"><emphasis>Note:</emphasis> Macintosh (<ulink
url="../../../Ports/mac68k/">mac68k</ulink> and <ulink
url="../../../Ports/macppc/">macppc</ulink>) systems use the
RS-422 protocol which has balanced pairs (positive and
negative lines) for transmit and receive. To connect a
balanced RS-422 line to a single-ended RS-232 line, tie the
positive receive data line (RxD+) to signal ground, and
leave the positive transmit data line (TxD+) floating. How
you wire HSKo and HSKi depend on application, though usually
HSKo is used as RTS and HSKi is used as CTS. Additionally,
some cable manufacturers try to tie DCD, DTR, and DSR
signals to various of the MiniDIN8 lines. See <ulink
url="http://francis.courtois.free.fr/jc1/serial/main.html">Interfacing
a Mac Serial Port to RS-232 Lab Equipment</ulink> for more
information. Beware of truly ancient Apple cables, as the
original Mac 128k and 512k models used DB9 connectors with
non-standard pinouts.</para>
<para id="sparc"><emphasis>Note:</emphasis> Some <ulink
url="../../../Ports/sparc/">sparc</ulink> systems use
MiniDIN8 connectors for serial, although others have DB25
connectors. The MiniDIN8 pinout is listed here. Some of
the DB25-based systems have a breakout cable (A/B) that
supports two serial ports. See the <ulink
url="../../../Ports/sparc/faq.html#serial-port-splitter">FAQ</ulink>
for the pinouts of this <ulink
url="../../../Ports/sparc/faq/sun_530-1677-01-rev50.txt">cable</ulink>
(the first set of serial lines are in standard DB25
locations -- you don't need an adapter).</para>
<para id="next68k"><emphasis>Note:</emphasis> All <ulink
url="../../../Ports/next68k/">next68k</ulink> systems have
two MiniDIN8 serial ports. The NEXTSTEP System
Administrator's manual has several examples of serial cables
for NeXT systems. See the <ulink
url="http://channelu.com/NeXT/NeXTStep/3.3/nsa/ApB_Cabling.htmld/index.html">
online</ulink> version, or the <ulink
url="http://www.radical.com/TheHome/TheSolutions/RadicalSolution6.html">
Radical System Solutions: NeXT Serial / Modem Cables</ulink>
page for more information.</para>
<para id="hp300"><emphasis>Note:</emphasis> All <ulink
url="../../../Ports/hp300/">hp300</ulink> systems which use
a 98562 System Interface Board have a non-standard DB9
pinout. This is what's listed here. All Series 400 models
have a DB25 breakout cable that supports three serial ports.
See the <ulink
url="../../../Ports/hp300/faq.html#serialdefs">FAQ</ulink>
for the pinouts of this <ulink
url="../../../Ports/hp300/serial.splitter.html">cable</ulink>
(the first set of serial lines are in standard DB25
locations -- you don't need an adapter). Additionally, the
948642A card supports four serial ports using <ulink
url="../../../Ports/hp300/dcmpinouts.html">RJ-11
jacks</ulink>. Everything else uses standard DB9 or DB25
connectors.</para>
</sect3>
<sect3 id="null">
<title>Common cables with modem signaling</title>
<para>Null modem DB25 to DB25 cable</para>
<screen>DB25 DB25
---- ----
1 GND --------------- 1 GND
2 TxD --------------- 3 RxD
3 RxD --------------- 2 TxD
4 RTS --------------- 5 CTS
5 CTS --------------- 4 RTS
7 GND --------------- 7 GND
6 DSR ---+
+----------- 20 DTR
8 DCD ---+
+---- 6 DSR
20 DTR ----------+
+---- 8 DCD</screen>
<para>Null modem DB25 to DB9</para>
<screen>DB25 DB9
---- ---
1 GND --- 1 GND
2 TxD --- 2 RxD
3 RxD --- 3 TxD
4 RTS --- 8 CTS
5 CTS --- 7 RTS
7 GND --- 5 GND
6 DSR --- 4 DTR
20 DTR --- 6 DSR</screen>
<para>Modem MiniDIN8 to DB25 (Macintosh, non-null
modem)</para>
<para>Note that RxD+ is shorted to ground, and that TxD+ and
GPi are floating. You should have the short as close to the
DB25 as possible, instead of near the MiniDIN8. If possible
have the RxD+ and RxD- as a twisted pair.</para>
<screen>MiniDIN8 DB25
-------- ----
1 HSKo ----------- 4 RTS
2 HSKi ----------- 5 CTS
3 TxD- ----------- 2 TxD
5 RxD- ----------- 3 RxD
4 GND ---+
+------- 7 GND
8 RxD+ ---+
6 TxD+ ---x
7 GPi ---x</screen>
<para>Null modem MiniDIN8 to MiniDIN8 (Macintosh "printer"
cable)</para>
<screen>MiniDIN8 MiniDIN8
-------- --------
1 HSKo --- 2 HSKi
2 HSKi --- 1 HSKo
3 TxD- --- 5 RxD-
4 GND --- 4 GND
5 RxD- --- 3 TxD-
6 TxD+ --- 8 RxD+
7 GPi --- 7 GPi
8 RxD+ --- 6 TxD+</screen>
</sect3>
<sect3 id="other">
<title>Other sources of information</title>
<itemizedlist>
<listitem>
<ulink url="http://teryx.bobdbob.com/~protius/pinouts/">
Tommy's pinout collection</ulink>
</listitem>
<listitem>
<ulink url="http://www.sunhelp.org/unix-serial-port-resources/serial-pinouts/">
Sun Serial Port & Cable Pinouts</ulink>
</listitem>
</itemizedlist>
</sect3>
</sect2>
</sect1>
<parentsec url="./" text="Hardware Documentation"/>
</webpage>
--eHhjakXzOLJAF9wJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="serial.diff"
Index: layout.xml
===================================================================
RCS file: /cvsroot/htdocs/layout.xml,v
retrieving revision 1.231
diff -u -r1.231 layout.xml
--- layout.xml 4 Apr 2007 08:21:51 -0000 1.231
+++ layout.xml 4 Apr 2007 20:36:20 -0000
@@ -56,11 +56,14 @@
<tocentry page="Documentation/Hardware/Machines/DEC/vax/othervaxes.xml" filename="othervaxes.html"/>
<tocentry page="Documentation/Hardware/Machines/DEC/vax/storage.xml" filename="storage.html"/>
<tocentry page="Documentation/Hardware/Machines/DEC/vax/cards.xml" filename="cards.html"/>
<tocentry page="Documentation/Hardware/Machines/DEC/vax/busses.xml" filename="busses.html"/>
<tocentry page="Documentation/Hardware/Machines/DEC/vax/monitors.xml" filename="monitors.html"/>
<tocentry page="Documentation/Hardware/Machines/DEC/vax/enclosures.xml" filename="enclosures.html"/>
<tocentry page="Documentation/Hardware/Machines/DEC/vax/full.xml" filename="full.html"/>
</tocentry>
+ <tocentry page="Documentation/Hardware/Misc/serial.xml" filename="serial.html"/>
</tocentry>
</tocentry>
<tocentry page="Documentation/books.xml" filename="books.html"/>
Index: Makefile
===================================================================
RCS file: /cvsroot/htdocs/Documentation/Hardware/Misc/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- Makefile 14 Oct 2005 08:59:55 -0000 1.5
+++ Makefile 4 Apr 2007 20:37:55 -0000
@@ -1,5 +1,5 @@
# $NetBSD: Makefile,v 1.5 2005/10/14 08:59:55 rillig Exp $
-LISTDOCS+= serial.list
+XMLDOCS+= serial
.include "../../../share/mk/web.site.mk"
--eHhjakXzOLJAF9wJ--