none

Home Job Pinball Photo Album Automotive Press/AwardsContact

HP-41CV Calculator

My handheld computer from my university days



This calculator was purchased in May 1982 from the WPI book store for $300.  Before that I had a TI-59 calculator, but this one was much better with the LCD display and the alphanumeric capability.  It also had expansion slots promising future upgrade and accessories.  Later in the year, I then purchased $350 of accessories in the form of a rechargeable battery pack (82120A), the optical wand (82153A), the magnetic card reader (82104A), the HP-IL interface (82160A), the RS232 interface (82164A), and many ROM and memory packs.

RS232 Interface
HP-41
                  system
The RS232 interface (82164A) connects to the HP-41 via HP-IL (82160A).
The Extended IO Module (82183A) is used also to provide
extra functions for the interface.

The connector on the interface is a male 25 pin, and needs a null modem cross-over to swap RX and TX to connect to a PC.  I have been going through the manuals to familiarize myself with this interface and so far I can send and receive characters/bytes to communicate with the PC or control embedded devices, and store and retrieve calculator programs with the PC.  The standard speed of the interface is 9600 bps. 

Some interesting commands:
    OUTXB - converts X register (decimal) and send over serial as hex byte.
        Examples: 33 is !, 65 is A

    INXB - waits for character to be received from serial.  X will have decimal of input.
        Examples: B is 66

    OUTACL - outputs over serial contents of Alpha register (except for first
        character) with return character (page 46).

    INAN - inputs number of bytes in X register.  Expects upper case.  First
        byte in Alpha register will be a D for data (page 46).

    OUTP - output program in Alpha register over serial interface.
The output with this command is formatted in "ASCII hex".  For example, if the byte 0xEA is intended to be sent, it will be packaged as a byte of 0x45 (in ASCII: "E"), and 0x41 (in ASCII: "A").  So basically, it is always in clear text and no non-printable characters.  I verified this with my Logic Analyzer.  This makes it convenient to copy from a terminal program into a text file to save programs.
By sending a variety of short programs, I was able to partially decode the stream format.  For example, for the following short program:
LBL AB, STO 00, END is sent as:
00 0A C6 00 F3 00 41 42 30 C0 01 09 40  <- bytes (plain text)
L1 L2 ?? ?? Tx LB 'A''B'Sx ?? ?? EE CS  <- meaning
where:
L1, L2 : length of the stream following, excluding CS
Tx : text following. If "00" is next, this is a label
LB : label tag
Sx : Store memory, STO 00 is 30
EE End marker
CS bottom 8 bits of additive check sum
INP - input program from serial interface.  This is the compliment of OUTP.
RS-232 Interface Links
  • Discussions about OUTP
    • HPILCOM introduction
    • LIFUTILS on github.  These may be useful for my HP Logic Analyzer
    • LIFUTILS user notes
  • User manual for this interface
  • Service Manual for this interface.  With schematic diagram.

Repair of the magnetic card reader
Being mechanical, there were several parts of this peripheral that have failed over the decades.  One unique repair for me is that one of the locking latches is broken.  After having taken it apart it was clear what happened.  The latch is very delicate and the spring detached from the clip due to a breakage.

broken latch
Broken latch on the right.  Spring retention clip is broken.


Home made vise to gently hold the parts while epoxy sets.
Broken one on the bottom.

A common issue with the card reader is the rubber wheel that pulls the card through.  It turns to a gummy material and renders the unit inoperable.  I tried running my reader and sure enough, it flashes a BATT indicator on the calculator display and the card does not go through.  I read the various repair guides (links below), and decided to perform a repair.


My unit opened.  I decided to not demate the wires connecting
the motor module as suggested in the repair video below.
"long gold pins" mentioned below are next to my thumb.
Reader Assembly board in top left.


Closeup of the disintegrated drive wheel.  The plastic did not turn to goo,
but into orange grains.  Some of these fell out as I removed the cover.
Based on links below, this is easier to clean up than the goo.


Cleaned up drive shaft.  The top narrow part is 0.124" OD. 
The wider one is 0.245".  This matches recommendations
 to use a 1/4" x 1/8" O-ring.


Graphic to understand the connection of the long gold pins.

There is a small yellow circuit board (known as the "Reader Assembly) that sandwiches some bronze metal strips and is connected by five long gold pins (mentioned in caption above).  I wanted to figure out what all this assembly was for.  To analyze how they work, I took a photo and used PowerPoint to flip the circuit board, change its color to blue/yellow, and made it semi transparent.  This allowed me to tell what touches what.  Tracing the conductors shows that these sense the location and presence of a magnetic card.  Using a numeric convention for the pins (pin 1 nearest to card exit).  The first switch that is hit is Switch A (Card Insert Switch), and that connects pins 4 and 5.  Per page 2-1 of the Service Manual, this activates the motor.  While Switch B (Head Switch) is the last one that stays closed as the card moves through connects pins 2 (CIS) and 3 (HDS).  Finally, the opto (Write Protect) connects to pins 1 (WPS) and 2 (CIS).  For the pin names see Figure 2-1 of the Service Manual.

To test the above contacts, I connected a DVM in tone mode to the above pins and passed a card through to make sure they work correctly before I did the final assembly (no drive wheel present).  I did this a few times to make sure they various springs were located correctly.

I found some "006" O-rings that measure 1/4"OD and 1/8" ID on Amazon (25 for $12), which are the type recommended in the various repair blogs.  Two of them fit snugly onto the drive wheel.  I then slid the wheel into place (see below) and pushed the axle pin in from the top.  The card chamber consists of two grey plastic halves that clam shell together.  One half is shown below and has the drive wheel and motor.  It also has a tiny curved spring that is not held by anything.  The other half has the small white pressure roller.  Up till now, there are no parts that would fall out, but now both halves have tiny parts that could fall.  I decided to place the white wheel into its half and could see it did not fall out.  I could then assembly the two halves with two screws.  Next, I screwed the card chamber into the base with the two screws from the outside.  Finally, I placed the yellow reader card circuit board onto the card chamber while carefully checking how the bronze metal strips were being compressed.
Now that the whole assembly was together, I tested the switches with the method above.  They seemed to work, but when I powered up to try a test with a card, I would get CARD ERR.  The motor would start, but it was not running consistently.  I then went back to the switch test and found the switch would sometimes show open as I manually pushed a card through.  After some repositioning of the bronze strips, and cleaning of the contacts, the switches worked reliably.


Closeup of the drive wheel with two O-rings.  The read/write head is below that.

Another part that fails is the damper/clutch at the output of the motor.  In my case it did not appear to be slipping as it showed LOW BATT error for my first try.  This told me the motor was drawing a lot of current, and the damper was not slipping.
Reassembly had the following tricky parts.  First, despite my best efforts, I mixed up the internal screws and they are all subtly different in length and pitch.  So bin them up separately as you disassemble the unit.  But hardest of all was the cover.  Due to the latches that hold the reader onto the calculator.  I found it best to hinge the cover on first (hook the side away from the calculator), and align and insert the two metal bars that hold the cover screws into their slots.  Then with the clam shell slightly open (on the side facing the calculator), place the spring bars of the latches into the curved panel and install that.  Press closed one side at a time.  A tricky operation but just be patient.  The next time I do this, it may be good to tack down somehow the spring latches into the curved cover.

In the end, the repair was successful as can be seen in this video.  I am real pleased with the results and can now read back a large pack of cards I recorded years ago.  I look forward to loading and running them.
Card reader Links
    • Lost Rabbit on HP Museum
    • Mark Hoskins on HP Museum
    • Peter Geiser
    • Video on Youtube
    • Service Manual

Rechargeable Battery Pack

I have an original Ni-Cd battery pack and it looks glued together.  I was able to cut it open with a high-speed abrasive wheel.  I was able to leave most of one panel uncut and so it hinges open and close.


Original rechargeable battery pack (82120A).  Some
corrosion evident in this 30 year old device.




Contents of original battery pack.

I looked at the circuit inside the pack and realized it does not match the one from Kees (it does match this one). Mine appears to be the older design, with three power pins, and the new one has two power pins and an additional zener.  The latter was attractive to me as my unit had an output of about 13V, presumably because the shunting effect of the battery was not present.  I decided to add a 6.2V zener for safety.  The Linear U1 below was indicated to be a 78L05 by Malte, but I measured 6.0 V.

Schematic of circuitry inside battery case.
D9 was added.

To make sure this design was thermally good, I removed the battery and checked the temperature of R1 and D9 with the pack plugged in.  Output was 6.2V, and these parts did not rise in temperature in a detectable way.


Comparison of original battery and new 1/3 AAA (bottom).
A bit odd to me that we have the same battery chemistry,
smaller size, but higher labelled capacity.

The old batteries are 15.5 mm long and 12.7 mm in diameter.  I believe they are 170mAh NiCads.  I found 1/3 AAAs on Amazon that are 16mm long (incl top button) and 10.5mm diameter.  They are NiCad 1.2 V @ 250 mAh, so 4.8V total.  $12 for ten.  Total space along the long axis of the battery inside the battery compartment is 18.5 mm, but 2-3mm space is needed for the retention spring.


I placed the new batts into the trapezoidal opening
of the case to get the spacing right.

One problem I had to solve was how to implement the spring function of the battery pack.  I decided to pull some springs from a AAA battery pack and solder them to the end of the battery.  I then tack soldered them in series and used the cover as the jig to space them out and hold them.  There is about 1.6mm of free space in the thickness dimension so I put two layers of 3M foam tape as a spacer.  I then wired the charger to the end terminals.  Note that this style is more like the later design of the charger.  In the original, there is a foil trace that powers the calculator and was separate of the positive battery terminal.  So in the later and my design, the four batteries power the calculator directly (with the new 6.2V zener in parallel for safety).
Once fully assembled and the batteries are at ~1.25 V (full), the trickle current is about 16 mA.  This meets the C/10 trickle charge level that is considered safe for NiCads.  Max observed voltage from the pack was 5.48 V with the charger connected.  As an ultimate test, the pack is able to power the magnetic card reader, which can reportedly draw as much as 500 mA.


Finished pack.  Note that the contact spring protrudes about
1 mm from the face of the case.

A follow-up, despite the pack being full (5.5V), I discovered the optical wand would not work on the rechargeable battery pack.  I had to temporarily switch back to the N cell batteries (Dec 2025).
Battery Links
    • Refurbishing the rechargeable battery (Kees).

Making HP-IL Cables
A check on Ebay showed that HP-IL cables are rather expensive.  Typically $35 to $50.  I decided to try and make my own based on work by Martin Hepperle.


Connector and parts being printed.

I merged the file for the panel mount and cable mount connectors and did three sets of prints in increasing resolutions.  The print time on my filament printer varied from 5 to 8 hours, with the highest resolution prints taking the longest.  I found that the higher res prints required less clean up and sanding.  The three batches were marked by a small dot of nail polish paint.  The low res were red, and the high res ones were silver.  I found that a range of 100-200 grit was best for sanding the pieces down.


Potting of pins and sockets.

The contacts have a diameter of about 1.37 to 1.47mm (latter were the sockets).  The holes for them were cleaned up with a 1/16" drill bit (1.58 mm).  I then soldered some 22 AWG wire to the contacts and mated the printed connector to a legacy one.  Following that, I inserted the contacts into the printed one from the 'back', and verified I had electrical continuity.  As shown above, I then potted the back of the connector to set the contacts into place.  Finally, I used my soldering iron tip to melt and join the back of the connector. 
Note that a pair of these contacts (pin/sockets) is about $5.  I found that they are comparable in size to a high density D contact, but since the spring feature is in the pin and not the socket.  It makes it difficult to find a good replacement.


Completed assembly.  Legacy 5m cable on left.  Newly made 0.3m on right.

Links for cable construction
  • HP-IL cables construction discussion
    • 3D printing connectors and housings.  Archived.
    • Pins on Digikey
    • Sockets on Digikey
PIL-Box- ILPer - HP41UC
I found this project by Jeff Garnier, called PIL-Box, to build a general purpose HP-IL to serial adapter.  He uses an 18-pin PIC, and provides the assembly code.  I decided to build his bus interface circuit on a daughterboard for the PIC P18-14 prototype board.  This board are low in cost (about $5 each) and are handy as they provide a power supply, easy connection to my ICD-2 programmer, and a serial port RS-232 shifter and D-connector.  Total cost with the PIC was about $10.

Test system with HP-IL interface circuit assembled onto a daughter board (dk green)
that plugs into the P18-14 prototype board.  The ribbon cable goes to
my logic analyzer.

Scope plot with Logic Analyzer overlaid (beige box).

Referring to the schematic of the PIL-Box, the above figure shows the voltage on U1 pin 1 with a packet sent over the HP-IL loop.  Overlaid onto that (beige box) is the sampled stream of my Saleae Logic Analyzer.  The DC offset is provided by the D1/D2 network, and 'floats' the DC voltage to about 2V.  C1 and C2 couple the received loop voltage onto R3 and the PIC is able to sample the stream.  Assuming its threshold is similar to the Logic Analyzer (about half 3.3V, or 1.5V), it will obtain the stream in the beige box.  So instead of sampling the HP-IL as a tri-level signal, it only samples the 'low' portions, using gaps to infer the location of the highs.  The 11-bit packet is decoded by the PIC and turned into two serial bytes and sent over serial UART format to the host PC.  This is in turn able to reply on the HP-IL using the other half of the PIL-Box (R6, R7, etc).  In operation, I found that the PIC does not output on AN1 nor AN3, there is also no modulation present due to the grounding effect of C3.  So I'm not clear why these lines are connected.  It may be a remnant of a previous iteration.
I followed the schematic closely in my construction, but added a jumper block to connect output directly to input to bypass this interface.  This was useful in initial construction.  I used 47 nF capacitors instead of 22 nF due to what was available in my spare parts.  I also used 200 ohms throughout the coupling network instead of the 150/220.  As you can tell above, I decided to not use the USB interface on the board, but plain RS-232.  ILPer handles this just fine as you select a COM port anyway.
There is a single LED on the PIL-Box, and it is used quite effectively.  Upon power up, it flashes three times.  A message on the loop causes it to flash briefly.  When the calculator and ILPer are both active, the LED turns ON (a handy confirmation), and flashes dark with every message.  ILPer also has a handy 'Scope' display that shows all packets being exchanged, and it is nice fuzzy to see a packet when the calculator powers up.


Logic Analyzer trace of input HP-IL stream (IN+, third from top), output (top two)
and serial stream with PC (TX, RX, on bottom).



Zoom in of thresholded input stream (IN+).


Zoom in of output to bus coupler.  Note cadence of pulses
to implement tri-level output on the HP-IL.

The PIL-Box converts HP-IL to serial (either USB or RS-232 in my case), and most of the loop is closed by a host software running on a PC called ILPer by Christoph Giesselink.  It provides high-level functions such as printer and mass storage.  I am quite impressed with this PIL-Box/ILPer package, and think it's an excellent way to update the HP-41CV for use in the modern PC era.


ILPer application that interacts with the PIL-Box to implement
a printer and mass storage device.

Using the "LCAT" program (Extended IO user manual), I could examine the modules that ILPer provides.  The listing shows (copied from the Printer window):
4 DEVICES
PRIMARY ADR. 1
ADR   ID    AID  CLASS
01 DISPLAY   46 PRINTER
02 HP9114B   16 MASS ST
03 HDRIVE1   16 MASS ST
04 DOSLINK   78 INTRFCE
This shows that the printer has an address of 01, and there are two mass storage devices.  You can use the calculator "SELECT" command to switch between the two mass storage drives.  You can see the corresponding PC files mentioned in the top left of the ILPer window.  Below that you see the DOSLink files (at address 04), but I am not familiar with its use. 
Some typical use of the two mass storage devices (commands on the HP-41):
SELECT - X points to which mass storage device to use (02 or 03 above)
DIR - print out directory of SELECTed device
WRTP - write program in ALPHA to SELECTed disk
READSUB - read in program in ALPHA from SELECTed disk.  Added as last program
PURGE - erase program in ALPHA on SELECTed disk
PRP - print program in ALPHA
The above mass storage devices (HP9114B and HDRIVE1) are maintained as .DAT files on the PC.  If they are copied over or renamed as .LIF files, another software tool called HP41UC by Leo Duran can further process them.  This tool runs from the Windows command line and is controlled by options (/l /t etc).
Here are some examples to describe a code editing flow.  This will allow one to view/write/edit an HP-41 program on a PC using a text editor, and compile it into a format to be loaded back into the calculator.

Operation
Cmd Line
Typical output
First, obtain options available for HP41UC

hp41uc
User-Code File Converter/Compiler/De-compiler/Barcode Generator - Version 3.01
Copyright (c) Leo Duran, 2000-2023. All rights reserved. leo.duran@yahoo.com.

Supported File Formats:
  LIF [ /l ]: transfer file for Trans41
  P41 [ /p ]: archive file for HP-41 programs on ftp sites
  RAW [ /r ]: input/output file for V41 abd LIFUTILS
  DAT [ /d ]: input/output file for EMU41 (using INP, OUTP)
  BIN [ /b ]: output file from 41UCC
  TXT [ /t ]: program listing (text)
  PCL [ /h ]: barcode printable file (Hewlett Packard PCL)
  PS  [ /s ]: barcode printable file (Postcript)
  WND [ /w ]: barcode hex-dump (Wand file)

File Converter:
  [ LIF, P41, RAW, DAT, BIN ] => [ BIN, DAT, RAW, P41, LIF ]
Compiler:
  [ TXT ] => [ LIF, P41, RAW, DAT, BIN ]
De-compiler:
  [ LIF, P41, RAW, DAT, BIN ] => [ TXT ]
Barcode Generator:
  [ RAW ] => [ PCL, PS, WND ]
Use a single option[ /b, /d, /h, /l, /p, /r, /s, /t, or /w ] for help.

Next, check what programs are in the .LIF

Note that only E080 type can be decompiled.
hp41uc
/l=HP9114B.LIF

LIF directory listing
 Name        Type  Size  Implementation
 --------------------------------------
 PILBOX      E0D0  000A  000A0020
 NUM         0000  xxxx  000A0020
 WRALL       0000  xxxx  01500020
   0000  xxxx  00000000
   0000  xxxx  00000000
   0000  xxxx  00000000
   0000  xxxx  00000000
   0000  xxxx  00000000
 LCAT        E080  010A  010A0020
9 directory entries found.

Decompile the program LCAT from the HP9114B disk
hp41uc
/l=HP9114B.LIF
/t LCAT
lif[HP9114B.LIF ] => txt[HP9114B.txt ]
872 bytes written.
Edit with text editor


Compile back into code and store into TRIAL.LIF

Copy back to .DAT for ILPER to use
hp41uc
/t=HP9114B.txt
/l=TRIAL.LIF
/n

txt[HP9114B.txt] => lif[TRIAL.LIF]
.END. found on line 93.
 Name[ HP9114B ]
 Type[ E080 ]
 Size[ 010A ]  ( 266 bytes ) - Registers Needed[ 38 ]
 Implementation[ 010A0020 ]
1280 bytes written.


HP-IL Links
  • Official spec
  • HP IL resource page by Jeff
    • Theory of operation for PIL-Box
    • PIL-Box schematic
  • ILPer by Christoph Giesselink (be sure to install the VS2005 Runtime package)
  • HP41UC code compiler and decompiler from Leo Duran.
  • Useful manuals for commands
    • HP-IL Module
    • Extended IO Module

TULIP
An even more powerful interface adapter is the TULIP, developed by Meindert Kuipers from The Netherlands.



TULIP Links
  • Tulip information presentation.  Video
  • Discussion threads
    • Main discussion thread on TULIP
    • Side thread discussion on the TULIP
  • Harvesting an HP-41 connector

General Links
  • HP-41 Service Manual
  • Museum of HP calculators
  • Discussion forum for old HP calculators
  • Bar Code Generator (archived from here)
    • Reader software to convert from bars to program listing.
  • Code compiler and decompiler.

Project Log
  • September 2025 - Went through my HP-41 inventory and found I have the RS-232 interface.  Started this blog.
  • November 2025 - Card reader and battery pack repair
  • December 2025 - Work on HP-IL cables and PIL-Box interface (in progress)
  • January 2025 - TULIP


Back Home