Epson HX-20

I am using the HX-20 as the focus of my Summer 2011 Retrochallenge Entry.

Whilst trawling the web for information I've found that a couple of sites no longer exist - thank heaven for the wayback machine!

The purpose of this website is to provide an online location for the information that is only available in the wayback machine's archives, or which I've found useful during my HX-20 explorations.

Battery Replacement

A common issue with the HX-20 is dead batteries. You can replace the existing battery with a new set of Sub-C cell NiCADs, rated at 1.2 volt. These are commonly used for model aircraft glow-plug starters. Note that these are not the more commonly available NiMH batteries - these require a different charging regime. Do a search for NiMH and HX-20 to find more information.

If careful the existing shrink-wrap can be cut off the old battery using a scalpel and can be used to house the new battery, with the aid of some electrical tape. Cut the cable off the old battery at the battery end. Check both the cable and connector for corrosion - if the connector is corroded (which is quite common) you can find a suitable replacement or attempt to revive the connector if not too badly corroded by submersing in vinegar overnight. A replacement doesn't need to be polarised if you use colour coded cable as the PCB is marked with a '+' for the positive connection.

A replacement power supply can be used if selected carefully. There is a lot of debate about what is suitable, but I've found a regulated 6 Volt 300 ma adaptor works well with a charge time of eight hours. Remember the original manufacturers instructions - it's best not to leave the HX-20 plugged in except when charging. The charging circuit is very primitive which is why you have to be careful with NiMH batteries.

This is a portable machine anyway, with a daylight readable screen, so get yourself into the garden and enjoy the sunshine!

Transferring Programs/Data from Ubuntu/Linux

I've found the following the only reliable method to transfer programs back and forth between a Linux based PC and the HX-20.

Linux setup: if you are using a USB to Serial adapter the device name will be /dev/ttyUSB0. If you are using a traditional serial port the device name will probably be /dev/ttyS0

Setup the serial port on Linux using the following command:

stty 300 -parity cstopb crtscts igncr opost onlcr </dev/ttyUSB0

Go into the BASIC interpreter on the HX-20 and enter the following command, then press RETURN:

LOAD "COM0:(28N23)"

Then cat your BASIC program to the serial device, for example:

cat UPLOAD.BAS > /dev/ttyUSB0

When finished the linux command prompt will be returned. Press the red BREAK button on the HX-20, then check the downloaded program with the LIST command.

I've found anything over 300 baud to be unreliable, but your milage depending on cable may vary.

The serial cable pinout I used is shown below.

Serial Transfer Cable

This is a DB9 to DIN-8 serial cable which plugs into the port on the HX-20 labelled RS/232. This port corresponds to COM0:

The cable information mirrors this page

  HX-20        PC       
8-pin DIN  9-pin subDE  function
    1 -------- 5 -------   GND
                        
    2 -------- 2 -------   HX-20 TxD, PC RxD
                        
    3 -------- 3 -------   HX-20 RxD, PC TxD
                        
               7 -+     
                  |        RTS - CTS loop
               8 -+     
                        
               6 -+     
                  |     
               1 -+        DSR, CD, DTR loop
                  |     
               4 -+     

Historic Computing by Martin Wölz

This is a back up HX-20 related items on the the now defunct website which can be found on the wayback machine: Historic Computing by Martin Wölz

Epson HX20 handheld computer
Epson HX20

Modem CX-21
Modem CX-21

hx20wiring.txt Serial cable wiring diagram for HX20-PC data transfer.
hx20man.pdf (880KB) HX-20 Operations Manual (English)
hx20qref.pdf (1.22MB) Quick Reference
SIDHA-Writer.tar Powerful commercial text editor. Multipart BASIC and machine code. With installation instructions
SIDHA-Dialog.tar Commercial terminal program. With installation instructions for multipart code
koch.bas Recursively draws the fractal curve described by Helge von Koch in 1903.
hx20bas.tar.gz Example programs (including terminal) from ftp://ftp.epson.com/hxpxqx/
BASICsamples.tar Collection from Albert Walter, including AI algorithm demo game.
hx20directory.tar Epson original microcassette managing software
DUMP.BAS
grab.c
roms.bas
Memory dump software. Can be used to produce images of the Epson firmware.
hx20disass.tar Disassembler in BASIC
rom image Assembler and Debugger written by Julian Wald
"Burn to a 27C128 eprom and place in the expansion unit."
tecnical data (German) contains all pinouts
description (German) by www.zock.com
original ad So it was!

Error Messages

The two letter error message codes from the Quick Reference Manual

Epson HX-20 Error Messages

Here is a table of the error messsages (also available as a text file):

Error CodeError NumberMessage
/011Division by zero
AO52File already open
BD58Bad data in file
BF51Bad file mode
BN50Bad file number
BO61Buffer overflow
BS9Bad subscript
CN17Can't continue
DD10Duplicate definition
DS56Direct statement in file
DU60Device unavailable
FC5Illegal function call
FD55Bad file descriptor
FN23FOR without NEXT
ID12illegal direct
IE54Input past end
IO53Device input/output error
IU59Device in use
LS15String loo long
MO22Missing operand
NE63File does not exist
NF1NEXT without FOR
NO57File not open
NR19No RESUME
OD4Out of data
OM7Out of memory
OS14Out of string space
OV6Overflow
PP62Protected Program
RG3RETURN without GOSUB
RW20RESUME without error
SN2Syntax error
ST16String formula too complex
TM13Type mismatch
UF18Undefined user function
UL8Undefined line number
UP21Unprintable error
WE24WHILE without WEND
WH25WEND without WHILE

SIDHA Writer

This is a BASIC and machine code based word processor for the HX-20. It can be found here: SIDHA-Writer.tar

The file WRITER06.BAS contains German instructions and commands. A version roughly translated into English can be found here: Writer06En.Bas

Command Reference

ShortcutGermanEnglish
AAnnulierenUndo
BBefehls-Moduscommand mode
CCopierenCopier
DDruckenPrint
EEingabe-ModusInput mode
FFindenFind
GGehe zu(+-)ZeileGo (+ -) line
HHelfenHelp
IInhaltContents
JJustierenAdjust
KKorrektur-Moduscorrection mode
LLadenLoad
MMengequantity
PPraeparierenPrepare
QQuerformatLandscape
SSichernSave
TTauschenTrading
UUhrzeittime
VVerschiebenMove
WWegnehmenremoval
ZZu EndeToo late

Installation Instructions:

**************************
   Computer Archaeology
**************************

Description of
        SIDHA-Writer V0.6 Ser.No. 00277
        (c) 1983 SIDHA GmbH, Germany

Analysis by 
        Martin Woelz, July 2002
        woelz@math.uni-goettingen.de

DESCRIPTION
-----------

SIDHA-Writer is a text editor for the EPSON HX-20 handheld
computer. Editing is done with the 20chars by 4lines display of the
computer, and output can be either the built-in or a full-size
external printer.

When the program runs, typing H produces a help on the built-in
printer. It says:

Befehle:

A = Annulieren
B = Befehls-Modus
C = Copieren
D = Drucken
E = Eingabe-Modus
F = Finden
G = Gehe zu(+-)Zeile
H = Helfen
I = Inhalt           [Cassette Directory]
J = Justieren
K = Korrektur-Modus
L = Laden
M = Menge
P = Praeparieren     [make Cassette "file system"]
Q = Querformat       [number of columns/line]
S = Sichern
T = Tauschen
U = Uhrzeit
V = Verschieben
W = Wegnehmen
Z = Zu Ende          [Quit]

The program consists of three files. Two are in BASIC, one is machine
code. Images are included in this package, and I will describe now how
to build a running version.

INSTALLATION PROCEDURE
----------------------

You need a serial link to the EPSON HX-20, and while you install the
software, you can also build a microcassette that will autoload the
software another time :)

The files on the original cassette are called
        Writer06 Sys (BASIC loader)
        Writer06 Com (the binary)
        Writer06 Bas (BASIC)

Inserting the cassette, then typing "LOAD" and "RUN" would get
Writer06.Sys going. It would set MEMSET to &H1750 to make room for the
binary Writer06.Com, which loads itself into &H0A40 to &H174F. Then
Writer06.Bas is loaded and run.

Downloading the BASIC files to the EPSON is straightforward. Consult the
file 'hx20wiring.txt' for the serial cable. On the
EPSON HX-20, you type
        LOAD"COM0:(38N23)"
and on your linux machine you do
        # cat Writer06.Sys >/dev/ttyS0

When cat is done, you stop the EPSON by pressing BREAK. The above
assumes your serial port is /dev/ttyS0 and that you have set it up with
        # stty 600 -parity cstopb crtscts igncr opost onlcr /dev/ttyS0
It takes some minutes.

Now your binary is in place. If you are making a microcassette tape, issue
        SAVEM"CAS0:Writer06.Com",&H0A40,&H174F,&0B00

Then you load (and save) Writer06.Bas the same way as you loaded
Writer06.Sys and just run it!

DISASSEMBLER
------------

To make it easier for you to understand the code, I have included a
disassembler output for the binary part. Writer06.Bas mostly calls it
at address &H0B00 if I am not mistaken. See the file 'Writer06.Com.disass'

Enjoy! And please tell me if you ever use this software!

Basic Programs

These programs were collected from a page stored in the internet archive.

NEW: Download programs from the distant past that will make the world's first laptop (the Epson HX-20) come ALIVE again. Digitally restored from micro-tape. These programs are not compatible with other RETRO-PCs; not even the Commodore 64. The HX-20 allowed the programmer to use commands that were unique to its 120x32 pixel screen, piezo-electric speaker, 8-bit ASCII character set and RAM pointers; all which I took advantage of.

Download all 68 files into 1 zipped file now (101K)