Archived 2013-12-08
This page has been archived and some links may not work correctly anymore. No updates of this page will be done anymore.
 

Information about RS232 serial communication / how to connect serial devices to the Palmtop HP 200LX

 
See also these useful resources:

HP connectors and link cables: http://www.keesvandersanden.nl/calculators/link_cables.php
The HP Cable Table: http://holyjoe.org/hp/cable.htm

 

Contents of this page:


Introduction:

This page describes the basics of the RS232 serial communication standard which is used by all standard PCs, most palmtop PCs (e.g. the HP 100LX, 200LX, 1000CX and 95LX, which are described in detail here) and many peripheral devices, such as modems, cellular phones, mice, scientific equipment etc.

You will also get concrete advice how to connect serial devices to your HP 200LX (or similar) palmtop.

General RS232 information

RS232 describes the standard for serial data communication between PCs and peripheral devices, such as modems, mice etc. and between PCs. Nowadays RS232 is replaced by USB more and more, but it is still an important standard, especially in the world of mobile devices, such as palmtop PCs and mobile phones.

There are two kinds of devices (from the viewpoint of RS232 communication): DTE and DCE. DTE stands for Data Terminal Equipment and means the "terminal devices", i.e. the PC or a simple terminal or in our case the palmtop; in general a device with a keyboard and a screen for manual data input and output. Printers are also DTE, because they act similar to a screen.
DCE stands for Data Communication Equipment, i.e. modems, mobile phones etc. To be honest, I cannot say for sure if mice are DTE or DCE. Does someone know?

You can connect two devices with RS232 in three combinations:
The usual connection is a DTE-DCE connection, e.g. if you connect a modem to your PC. This is done with a straight-through 1:1 serial cable.
The other kind of common connections is a DTE-DTE connection, for instance, if you connect two PCs in order to exchange data between them. For that kind of connection you need a so-called null modem cable.
The third kind of connections is DCE-DCE. You need a so-called tail circuit cable for that, but since this is a very uncommon kind of connection, I won´t describe it here.

Other parts of the RS232 specification:

      • Signal voltages: -5V to -15V (logical 1), +5V to +15V (logical 0) on the sender side, -3V to -15V (logical 1), +3V to +15V (locical 0) on the receiver side. Typically on a standard PC +/-12V is used.
      • Maximal cable length: 50 feet at 19200 bps, 3000 feet at 2400 bps (you can go much higher without troubles in most cases)
      • Connectors: The most common RS232 connectors are the DB-9 and DB-25. They exist each as male and as female variations, in most cases the DTE has a male and the DCE has a female connector (although this can be different in some cases).

        The 200LX serial port looks like this. It is also a DTE device:

        [backup battery, IR] [1 2 3 4 5 ] [12V DC jack]
                             [6 7 8 9 10]
              
      • Signals: The following table is valid for the connectors on all DTE devices, including the 200LX palmtop, since its pin numbering is identical to the DB-9 pin assignment standard:
        DB-9 / |  DB-25  |  Signal  |  Direction    |  Description
        200LX  |         |          |               |
        -------+---------+----------+---------------+----------------------------
            1  |      8  |    DCD   |  Modem -> PC  |  Data Carrier Detect
            2  |      3  |    RxD   |  Modem -> PC  |  Received Data (by DTE)
            3  |      2  |    TxD   |  PC -> Modem  |  Transmitted Data (by DTE)
            4  |     20  |    DTR   |  PC -> Modem  |  Data Terminal Ready
            5  |      7  |    GND   |               |  Signal Ground
            6  |      6  |    DSR   |  Modem -> PC  |  Data Set Ready
            7  |      4  |    RTS   |  PC -> Modem  |  Request To Send
            8  |      5  |    CTS   |  Modem -> PC  |  Clear To Send
            9  |     22  |    RI    |  Modem -> PC  |  Ring Indicator
           10  |      1  | prot.GND |               |  Not on the DB-9. Protective ground:
               |         |          |               |  Shield of plugs and cable are connected here
               
        The DB-25 has much more signals, such as a second transmission set, but they will not be described here.
        DCD, DTR, DSR, RTS and CTS are so-called handshaking lines, which the devices use to exchange information about their status. If they are needed and used depends on the kind of data transmission you run and on the software which handles the transmission. In the section below you can read more about handshaking.
        For a detailed explanation of the signals please click here!
        If you want to learn more about the RS232 standard please refer to RS232 references on the Internet, or read this very complete TTY summary by Chris Blum (uart.txt, 100kB).

Anomalies of the serial port of the HP 200LX

  • Connector: The 200LX needs a special connector, see above. The pin numbering is identical to the numbering of a DB-9 connector. In addition it has a pin 10, which you can connect to the shield of cables and plugs. Please don´t connect that to pin 5 (signal ground), since some power supplies of PCs are defective and thus the metal housing (which is connected to all shields) may lead a high voltage which could damage the serial port electronics.
    If you want to build your own plug which fits into that connector, please see here.
  • Signal voltages: The 200LX is a battery-driven device, which is designed to save power whereever it can. So it does on the serial port. The signal voltages are lower than on standard PCs, namely up to about +/- 6V idle voltage. This still meets the RS232 specifications, but it may lead to problems if you connect power-hungry devices which are powered by the port itself. So some mice or other pointing devices don´t work and especially some data cables for cellular phones may have trouble with this, if they are powered by the computer, not by the phone.
    Also the maximal cable length may be reduced by these low signal voltages.
  • UART: In modern PCs the 16550A UART (Universal Asynchron Receiver / Transmitter) is used which has a FIFO buffer built-in. The palmtop only has a 16450 compatible UART and thus has no FIFO buffer. That is the reason why the maximum speed which data can be transmitted at over the serial port may be limited depending on the way the software is programmed. With a very effectively programmed software (assambler-written) you can still use 115.200 bps if your palmtop has the double-speed upgrade. With a single speed palmtop 57.600 bps should work. If you use more complex software packages such as WWW/LX or Nettamer, you may be limited even more in transmission speed. 38.400 bps (double speed) or 19.200 bps (single speed) should always work without problems, even if the processor has much more to do than sending and receiving data over the serial port.
  • Power management: The serial port of the palmtop can be switched off to save power (the driver chip of the serial port drains power whenever it is not explicitly switched off). If the port is not used, it should be switched off to save power. But if you want to use it, you must make sure it is switched on, otherwise some software may run into troubles saying that no device is connected or a driver is missing or similar things. The power of the serial port can be controlled by the built-in program serctl. type in (or use in a batch file) serctl /w to switch the serial port on and set it to "wired" and use serctl /o to switch the port off again. serctl /i switches the port on and sets it to use the IR interface instead of the wired port.
    LXPRO by Stefan Peichl is a TSR which can control the serial port via hotkey (and many other useful things), SETCOM1 is also written by Stefan Peichl and can be used in batch files to control the serial port just as serctl does, but you can in addition set the port speed and bit patterns.

Cables and adapters for use in serial communication lines

Here various kinds of cables and adapters are described, including 200LX-specific ones:

The straight-through serial cable

This cable is mostly available with 25 pin connectors (DB-25) on both sides. It has one male and one female connector. You can establish any DTE-DCE connection with it, since it connects all pins exactly 1:1. In case one of the ports you want to connect has only 9 pins, you need a 9pin-to-25pin adapter. There are also 9pin-to-25pin cables and 9pin-to-9pin cables available, though.

The null modem cable or null modem adapter:

This one comes in many variations. What they all have in common is that the RxD and TxD lines are crossed, so you can establish a DTE-DTE connection with them (e.g. connect a palmtop to a PC to exchange data between them).
Some of these adapters or cables don´t have any more lines than RxD, TxD and ground, these are the cheap ones. Others have so-called loopback handshaking in the plugs, so handshaking is only faked for software which fails without signals on the handshaking lines. This is no real handshaking of course. If one device wants to say to the other one "I am ready, please do your job", it actually says that to itself. Vice versa, if a device is told to do its job by the line which says "the other device is ready", it actually is told that itself is ready. In more detail, when loopback handshaking is used, on every side the lines DCD (1), DTR (4) and DSR (6) are electrically connected and so are RTS (7) and CTS (8).
You should usually prefer real handshaking, so you should use a partially or full-featured handshaking null modem cable / adapter. This one has all handshaking lines, and these are also crossed in the correct way. See circuits below. If you cannot use a full-featured null modem for some reason, make sure to enable software flow control ("Xon/Xoff") on both ends in the software you use. This replaces the RTS/CTS hardware handshaking mechanism.
You can read more about handshaking in the section Handshaking mechanisms at the bottom of this document.
Null modem cables and adapters come with almost any combination of connectors on both ends. Try to find one which fits your needs, so you don´t have to buy expensive gender changers or 9-25-adapters.
Following you see a few circuit layouts of null modem cables:


"dumb" null modem without handshaking (only 3 wires needed)


loopback handshaking null modem (also only 3 wires needed)


partial handshaking null modem (7 wires needed, RTS and CTS of one party are connected to DCD of the other party)


full-featured null modem (8 wires needed, the safe choice, RI is not connected, usually it is not needed. Connect it too, if you need it!)

The null modem adapter which comes with the connectivity pack of the 200LX is a full-featured null modem adapter and has two male DB-9 on the ends ("5181-6639"):

And this is a full-featured mini null modem adapter (one male and one female DB-9 end):

The 9 pin to 25 pin adapter

These have usually all lines which are available in a DB-9 connector. They simply map the 9 pin layout to the corresponding pins of the 25 pin connector. They have either a male DB-9 and a female DB-25 or vice versa:

The Gender Changer

Gender changers simply change the gender of a plug. Their wiring is 1:1 and there are 2 kinds:
Female to Female and
Male to Male.
They can have either DB-9 or DB-25 connectors on their ends, I have also seen some which have DB-9 on ont side and DB-25 on the other side. The latter ones are combined 9pin-to-25pin-adapters and gender changers.
Here are examples of a 25pin male and a 9 pin male gender changer:

The 200LX connectivity cable (F1015A)

This is not a serial cable, but a full-featured null modem cable with a 200LX plug on one end and a female DB-9 on the other end. Is is designed to connect the palmtop to a PC. So, if you want to connect a modem, a mouse or a cellular phone (or any other device which is usually connected to the serial port of a PC) to the palmtop, you need one more full-featured null modem adapter in series to this cable to re-do the null modem wire crossings. Such a null modem adapter comes with the HP connectivity pack. Read on for more information.

A short 1:1 serial adapter for the 200LX

You can easily add a "standard" serial port (i.e. a male DB-9 connector) to the palmtop, so that you can simply plug in any device which you can also plug into a serial port of a PC. Either build the adapter yourself, it could look like mine:

(simply connect all pins 1:1, instructions to make a 200LX plug are available here), or buy such an adapter from Rundel Datentechnik (Item #1098).

The serial to parallel converter

This is an active electronic device, which converts serial data into parallel data (but usually not vice versa! You need a so-called "bidirectional" serial to parallel converter to have both directions of conversion). It is needed if you want to connect e.g. a parallel printer to the palmtop. Such a converter is expensive (usually 30 .. 100 US$) and available either as one box with two connectors or as a cable with a box on one end. A cable which fits directly into the 200LX serial port is offered by Thaddeus Computing. Usually these converters have one DB-25 connector on the serial input end and a Centronics parallel printer interface on the other end. Most of these converters are unidirectional, that means, they cannot be used for bidirectional parallel devices (such as Iomega ZIP drives, Memory card readers etc.) and the data transmission may be limited by the 200LX serial port. Try with 9600 bps and go higher and higher until you don´t notice any speed improvement. Take care that you can adjust the speed of the converter, e.g. with DIP switches. If you cannot, the speed is probably hard-wired to 9600 baud.

How to connect device X to the palmtop

This section describes what you need in order to connect a specific device (or a kind of device) to the palmtop HP 200LX.

Another PC (for file transfer or Internet connection sharing)

You only need the HP connectivity cable. Maybe you need a 9pin to 25 pin adapter on the PC side.
You have several options of software to use if you want to transfer data between the palmtop and the PC over the serial line:

  • Filer on the palmtop, Total Commander with HPLX communication plugin on the Windows-PC (very reliable and fast, recommended!)
  • Filer on the palmtop, Transfile Win200 on the Windows-PC (easy to set up and to use, but some shortcomings in usability)
  • MS-DOS Interlink / Interserver (interlnk, intersvr), comes with MS-DOS
  • Laplink Remote Access (you had to buy a copy for the PC)
  • ZIP (this is not PKZIP!) (very fast and reliable command-line tool)
  • X-Finder and X-Finder Server
    (said to be very reliable and fast)
  • Kermit
    (command line tool)
  • Win32 Filer (connection between a Windows PC and the palmtop´s filer application)
  • Norton Commander offers a file transfer connection, similar to the filer of the palmtop

...and probably many others. Please note that the palmtop may not be able to handle high-speed transmission, depending on the kind of software you use and the clock speed of the palmtop the data rate may be limited to 57600, 38400 or even 19200 bps.

You can also use the connection to another PC to share one Internet connection between this PC and your palmtop. This means you have to run a program on the PC which lets you use the existing Internet connection of the PC (no matter if via modem, DSL, Ethernet, ATM, wireless LAN or whatever) over a PPP connection over the serial port. Such software exists for Windows 9x and is called MochaPPP. If you run Linux on your PC, you can easily configure IP masquerading, IP forwarding (with iptables) and the pppd as PPP server for the serial line. Please visit my Internet connection sharing page for detailed instructions!.

A modem

You need either
The
200LX connectivity cable, a full-featured (!) null modem adapter and a serial cable (the serial cable usually comes with the modem), or you need:
A
1:1 serial adapter and a serial cable.
You may also need a
gender changer and / or a 9pin-to-25pin-adapter if something doesn´t fit together.
Regarding Internet and fax software recommendations, please have a look onto my
mobile-hplx page!

A cellular phone

(Please note that you can also connect a cellular phone via IrDA to the LX, if the phone is IrDA capable!)
You need either
The 200LX connectivity cable, a full-featured (!) null modem adapter and the phone-specific data cable, or you need:
A 1:1 serial adapter and the phone-specific data cable.
You may also need a gender changer and / or a 9pin-to-25pin-adapter if something doesn´t fit together.
Regarding Internet and fax software recommendations, please have a look onto my mobile-hplx page!
Please note also that there are problems with some phone-specific data cables. Some data cables don´t use the DCD line, which can cause problems, and some data cables are designed to be powered by the PC´s serial port, which can cause problems if they need too much power. For further information have a look onto my mobile-hplx page.

A pointing device (e.g. a mouse)

Why could someone want to use a mouse with the palmtop? Well, there are a few possibilities: MS-Windows 3.0 can be run on the palmtop in real-mode (the picture shows a mouse with a self-made connector, not with the cables described here), so you could use MS-Word 1.1 and MS-Excel 1.0. There are also CAD and drawing programs which run on the palmtop.
You need either
The 200LX connectivity cable, and a null modem adapter or you need:
A 1:1 serial adapter.
You may also need a gender changer and / or a 9pin-to-25pin-adapter if something doesn´t fit together.
Don´t forget to load a suitable mouse driver and note that the serial port has to be switched on all the time during the mouse driver is loaded and you use the mouse. The best option is to do that in a batch file. Say, your application which uses a mouse, is named app.exe and your mouse driver is mouse.com and can be unloaded with mouse.com /u. Then you should always start app.exe with the following batch file:

@echo off
serctl /w
mouse.com
app.exe
mouse.com /u
serctl /o

This makes sure the serial port is always ready for the mouse and the driver can instantly see the mouse.
Technical info: Most mice use the TxD, RTS and DTR lines as power supply. The PC receives the mouse signals via RxD. GND is also needed, of course.

A serial printer

I have never done that, so I can only explain theoretically:
You need either
The 200LX connectivity cable, and a 9-to-25-adapter (or the "printer adapter" which comes with the connectivity pack, this seems to be a simple 9-to-25-adapter)
or you need:
A 1:1 serial adapter and a null modem cable
You may also need a gender changer and / or a 9pin-to-25pin-adapter if something doesn´t fit together.

A parallel printer

You need either:
The 200LX connectivity cable, a null modem adapter and a serial to parallel converter,
or you need the "Greenwich cable", which is sold by Thaddeus Computing.
or you can use one of the programs OMNIPRN and COM2LPT to use a printer which is connected to your desktop PC. The desktop PC then acts as a serial to parallel converter.

A Thermometer

You need the instructions to build a palmtop thermometer ;-). Please see here.

The serial port of the HP 95LX

The HP 95LX has only 4 pins (ground, TX, RX, shield). You can use a female connector with 4 pins in 1 row (2mm grid) as a plug for the 95LX´s port. Such a connector can be found for example as CD-ROM audio connector (These flat black ones).

If you look on the serial port of the 95LX, the pins lead the following signals:

 
_______________
| A | B | C | D |
 \_____________/


A: shield ground   (if connected to a standard DB9 connector: connect it to the housing)
B: TX              (Pin 3 of a standard DB9 connector)
C: RX              (Pin 2 of a standard DB9 connector)
D: signal ground   (Pin 5 of a standard DB9 connector)

 

If you want to make a normal serial cable (e.g. to connect a modem to the 95LX), use the wiring described above for the DB9 connector. To make a null modem cable (e.g. to connect the 95LX to another PC for data transfer), swap pins 2 and 3.

With that information and combined with the tables and drawings above, you should be able to build any cable you need for the HP 95LX. But be aware that because of the missing control lines, some software could get into trouble. This can probably be avoided if "software flow control" is enabled on both sides (XON/XOFF), since the hardware flow control lines (CTS/RTS) are missing.

Handshaking mechanisms

For serial data transmission, there are two kinds of handshaking:

  • Hardware handshaking (RTS/CTS) and
  • Software Handshaking (Xon/Xoff)

Independant from that, there are two more control lines: DTR and DSR. They are only important at the beginning and the end of a data transmission. This is also called "handshaking", but doesn´t mean the handshaking during the data transmission. See below.

 

  • DTR/DSR: These control lines assure that there are really two devices present which want to communicate with each other: First, the DTE sets DTR "high", then the DCE answers setting DSR "high".
    These two lines are kept high during the whole transmission process. If the transmission has to be interrupted (because of a modem hang-up for example), the DCE drops the DSR to "low" so the DTE knows the transfer is finished.
  • RTS/CTS: These are the actual flow control lines: The sender sets RTS "high" (ready to send), the receiver answers setting CTS (clear to send) to "high". If the receiver needs a pause (buffer overflow, for example), if drops CTS to "low", so the sender knows it has to wait with further transmission until the receiver has set CTS "high" again. This way it is assured that no data is lost.
  • Xon/Xoff: This method can be used if no RTS/CTS lines are available. It is simple: If the receiver cannot handle more data (due to a buffer overflow, for example), it sends the Xoff character (Ctrl-S, ASCII 0x13) to the sender, so the sender knows it has to wait with further transmissions until the receiver sends the Xon character. If the receiver is ready again, it sends Xon (Ctrl-Q, ASCII 0x11) and the sender continues to send data.
  • the DCD line is only used by modems. It is set to "high" by the modem to let the computer know it has detected the carrier tone of the modem on the other side (i.e. it has a connection to the other side).

Do you like to support me?

Dear fellow Palmtopper!

If you like, you may reward me for the work I put into this website with a donation.

 

For a donation in US$:

For a donation in €:

Your donation, even if it's just a single USD, will help me to:

  • finance the server that hosts the site
  • justify time I spend with maintaining the site and do not spend with earning money otherwise (wife is watching! ;D)
  • just continue to be motivated :)

Since my company "hermocom" does not exist for many years anymore, I am now spending my spare time and private money for all of this. Thank you very much! 🙂

Yours truly,
Daniel Hertrich