An Introduction to the HHP-16K EPROM Emulator


Ron Fredericks writes: The HHP-16K EPROM Emulator allows application code to be read by Hewlett-Packard’s (HP’s) HP-41 calculator. Instead of inserting a small pre-built module into one of the four module bays of the calculator, such as the PPC ROM module discussed in one of my previous blog posts, this unit allows a person to use custom built programs previously stored into EPROMs (Erasable Programmable Read Only Memory devices) using software development tools and an EPROM burner.

Figure 1: HPP-16K Emulator Connected to HP-41 Calculator

HPP-16K EPROM Emulator connected to HP-41 Calculator
Photo by Ron Fredericks using Canon EOS-10D 34mm fluorite lens, UV Filter, 1.5s & f/22 @ ISO 100, on tripod, from Embedded Components’ HP lab collection.

Business Development using EPROM

The HHP-16K represents, a stepping-stone from source code to mass marketing through the use of HP’s commercial software development tools and it’s professional services team. Advertisement and promotion of HP’s professional services to productize HP ROM modules from EPROMs could be found within HP’s own software development tools, and in newsletters — newsletters published by HP and by independent self-assembling developer communities such as national and international versions of the HP Computing Club or HPCC.org. HP’s fee for this service was not trivial, often HP computer clubs would collect donations from 100’s or 1000’s of their members to raise the $20,000 to $60,000 (in 1980’s dollars) to produce these ROM modules for their members – all before the Internet.

This emulator is an example of an important design pattern for modern day software developers forming into ecosystems around mass marketed smart consumer devices!

A typical consumer device in today’s market often has gigabytes of flash memory or other extensions via cellular networks, enterprise networks, or WI-FI Internet access, that behave just like this old 16 kilobyte emulator. With this design pattern – developers can improve the consumer’s experience on popular devices by adding new software applications, middleware, content, and development tools. While at the same time, developers gain significant new business development opportunities for themselves, content providers, software tools vendors, professional services teams, and device manufacturers alike.

Although this emulator is an old technology, circa 1981, the EPROM chips, development tools, and HP-41 calculator itself are still in use by many collectors and developers alike. I decided to write about this particular unit because documentation is not readily available – making this project an interesting reverse engineering challenge for me. But I am also writing this post to unravel the mystery behind the business case for the HHP-16K. Only by resurrecting the engineering steps to use this device can we be certain that we have understood its business impact on software tool vendors, consumer device manufactures, and third-party software developers. Read on to learn, with me, how to use this device, and uncover the historical documents related to this device. Then perhaps we can extend this example from a reusable embedded engineering method to fresh reusable ideas for building business relationships with today’s software, tools, and mass marketed smart consumer devices.

I will continue to update this post until I am satisfied others can use it to build their own programs for their HP-41 using this unit. Only then can I be satisfied that I have fully documented how to use this unit and appreciate its impact in the marketplace – historically and as a future design pattern for others. This paragraph will be erased at that time.

“Kelly McClellan, Jim De Arras and other users reverse-engineered the [HP-41] Nut processor bus and instruction set [PPCV6N6P4][PPCV7N3P20], and built EPROM boxes and MLDL (RAM) devices in order to run their own microcode.”
Link to this article…

This unit appears to be the work of Mr. De Arras, since the printed circuit board has the following title:

41C EPROM Interface Copyright 1981 by J DE ARRAS REV C

The unit was manufactured by:

F.M. Weaver Associates
Hand Held Products Div.
6201 Fair Valley Drive
Charlotte, NC 28211
USA

Overview of EPROM Emulation

There are over 100 HP software solutions and community software built onto ROM modules listed on popular HP-41 web sites that can be stored on EPROM. HP authorized their reuse in emulators several years ago. In addition user code and assembly language code can be compiled and linked for deployment on EPROMs as well using freely available open-source tools.

The idea is to burn EPROMs following the M-Code 10-bit word format used by the HP-41 series calculators. I have not found the original documents for the HHP-16K unit but there are a few online resources to help guide a current-day embedded engineer tracing the footsteps of the past and current HP 41 developers.

Figure 2: HPP-16K Main Circuit Board

HHP-16K Circuit Board (top view, small size)
The figure above shows the top view of the circuit board: note the two DIP switches (I still need info on these) and three EPROM sockets.

Click here to see the bottom view (inverted so it can be overlaid with the top view).

ROM Memory Requirements

There are a few articles on burning EPROMs for the HP41. The table below was extracted from one such article titled: “Creation of EPROMs for EPROM readers”. Link to this article (in French)…

The lower 8 bits would use the two larger EPROM sockets and the upper 2 bits would use the smaller EPROM socket.

EPROM Chip Selection
HHP-16k
U2
L8
4K
1x 2716
1x 2732
8K
1x 2716

2x 2732
or
1x 2764

12K
1x 2732

1x 2732
and
1x 2764

16K
1x 2732
2x 2764

In the table above, U2 and L8 refer to the EPROM sockets on the circuit board – see the figure above.

ROM Address
Selection
4K Page
Port Number
F
E
4
(card reader)
D
C
3
B
A
2
9
8
1

Use the table above to define the HP41 I/O Ports required to access programs stored in ROM. See figure below for location of I/O ports on the back of the HP41 device. Typical HP-41 ROM modules are shown to the right of the calculator, while the electrical contacts can be seen within the other empty port bays.

Figure 3: HP-41 I/O Ports (back view)

HP-41 Calculator back view, with some I/O modules, and I/O ports labeled from 1 to 4

HHP-16K Emulator Hardware Discussion

Data lines to emulator circuit board
Blue wire = Vcc
Yellow wire = ISA (out) line from calculator to emulator
Green wire = ISA (in) line to calculator from emulator
Shield wire = Ground
Red wire = Ø2 line
Orange wire = SYNC line
Brown wire = Ø1 line
See the Input / Output Ports table below for signal line definitions.

Figure 4: HPP-16K Interface Circuit Board

HHP-16K Interface to Calculator
The figure above shows the interface from the HHP-16K device to the HP41 calculator ROM bay.

In this section I discuss the HP-41 calculator I/O ROM port in detail. Much of this information comes from HP’s internal documentation – specifically the “HP-41C/CV/CX Alphanumeric Programmable Scientific Calculator Service Manual” record number 00041-90472, printed 1983. You can read this and other HP internal documents on the HP-41 from Warren Furlow’s site here.

Input / Output Ports
The four I/O ports on the HP-41 allow the user to expand the calculator’s capacity and to have it interact with external components (like the HHP-16K Emulator). Electrical contact is provided by a flexible printed-circuit strip mounted on the contact frame. The system lines which are accessible at the I/O ports are defined below.
I/O Port View
VBAT
Battery voltage: Four 1.5 volt N size batteries.
VCC
System voltage: While the display is active (RUN and STANDBY power modes), the system voltage is regulated at 6V (at VCC). When the display is inactive (SLEEP power mode), the voltage output is unregulated and set to 1V less than the battery voltage.
GND
Ground
DATA
Data timing line: 56 bits of data make up one data word, with data represented as BCD (Binary Coded Decimal) numbers. Instructions and addresses are represented as binary numbers. The timing of the system is referenced to the Ø2 signal from the CPU. A bit time (the period during which a single bit of data is transferred) is the time interval between the trailing edges of two successive Ø2 pulses. A word time consists of 56 bit times (0 to 55) and is the basic interval for information transfer.
ISA
Instruction/Address line
Ø1
Timing lines with a system operating frequency between 343 and 378 kHz. Ø1 pulses lead the Ø2 pulses by approx. 3/8’th period.
Ø2
SYNC
Timing/Information line: The SYNC signal, consisting of a 10 bit pulse during bit times 44 through 53, has two main functions. The first SYNC pulse generated during power-up is used to initialize the timing circuit of the system IC’s. Subsequently, the presence or absence of the SYNC pulse indicates whether information on the ISA line is an instruction or and address. The SYNC pulse is suppressed when the system is controlled by a plug-in accessory. Additionally, when the CPU timing circuit is disabled (STANDBY and SLEEP modes), the CPU sets the SYNC line equal to the DPWO signal from the display driver for access at the input/output ports.
F1
Input flag line
PWO
Power on/off line
B3

ROM port identification lines: The B3 and B4 lines from each of the four ports are wired differently at each port so that each plug-in accessory will have a unique identification code.

I/O Port
Location
I/O Port
Number
B3
Contact
B4
Contact
Upper Left
1
Open
Open
Upper Right
2
Vcc
Open
Upper Left
3
Open
Vcc
Lower Right
4
Vcc
Vcc
B4
Timing Waveform Diagram

Timing Diagram

The CPU checks status of the system and the I/O ports by setting the PWO line high at bit time 54to enable the ROM. The CPU carries out specified operations by executing a series of instructions contained in ROM. The CPU obtains each instruction from ROM by transmitting the 16-bit address of the instructions over the ISA line during bit times 14 through 29. The ROM containing the address transmits the contents of that location over the ISA line during bit times 44 through 53.

HHP-16K Hardware Bring-up

Upon initial inspection, the HHP-16K device and ROM interface have likely been opened many times. So before risking potential damage to a HP-41 calculator and to insure best chance of success in my first use of this device I use a Digital Multimeter (DMM) to trace continuity and measure DC voltage levels at the Vss (ground) and Vdd (DC supply) pins of the various logic chips.

Figure 5: Reverse Engineer the HHP-16K Interface Circuit

Trace Interface with DMM
Larger view in separate window

Start with the ROM interface that plugs into one of the four HP-41 I/O ports. In this way we can insure that the small circuit board inside the interface is oriented correctly with respect to Vdd and Ground when we plug it in and turn on the calculator.

Note the DMM reading is in megohms (less accurate readings) and not in just ohms (more accurate readings). The reason for choosing the high ohm scale is that the voltage across the probes is much less: 1 volt across probe tips on megohm scale vs. 6 volts on the ohm scale. The lower voltage insures no risk of damage to parts during resistance/continuity measurements.

Figure 6: Check DC Voltage on HHP-16K Main Circuit Board

Check DC Voltage Levels

Second, proceed with DC voltage test of power rails by putting the HPP41-16K Emulator into a calculator ROM bay. Apply power to the unit by turning on the calculator. Measure the 6 volts from Vdd to ground on the logic chips located on the main board. The various chips on-board are all CMOS logic packages manufactured by Motorola. Pin-outs and logic details are easily found from online datasheets by searching on easy to read part numbers.

Third, confirm our findings and test the dynamic behavior of the interface using a logic analyzer. I have a HP 1631D that will do the job very nicely. Note how similar my captured waveforms are to the HP service manual’s waveform diagram for the calculator’s I/O port (see above):

  • The SYNC line is inverted since the interface buffers it with only one hex inverter/buffer from the MC14049 CMOS chip.
  • The x-to-o cursor measurement was done at 4X magnification. The period as seen on the display is 2.8 microseconds, or 357 kHz – well within the reported frequency range discussed above for Ø1 (PHI 1 label) and Ø2 (PHI 2 label) timing lines.
  • The HHP-16K interface includes logic to multiplex ISA signals to and from the main circuit board. The ISA I (or ISA Input) line shows the address and instruction data while executing a “Catalog 3″ operation – so the signals shown were captured while the calculator was accessing onboard ROM. ISA O (or ISA Output) is held low since the EPROM chips have not been programmed yet and therefore offer no function headers to support the Catalog operation.

Figure 7: Capture an HHP-16K Waveform Diagram

Timing Traces from HP 1631D Logic Analyzer (upper); along with test bench setup (lower)
Larger view of test bench setup in a seperate window

EPROM Configuration Logic

The HP-41 ROM space uses a 10-bit word size. To store the ROM words in standard EPROMs (8-bit bytes), the HHP-16K uses separate EPROMs for the lower eight bits (L8) and upper two bits (U2). To conserve space the onboard logic translates the upper two bits of four consecutive 10-bit ROM words into one 8-bit byte on the U2 EPROM.

Burn EPROMs

There are three different starting points to this step depending on where the source code resides. We could start with user code (high level source code), microcode (assembly code), or a previously built ROM module already in use on HP-41 calculators (binary code). I will focus on the use of previously built ROMs as there are so many license-free and available for use on an HP-41 calculator emulator. The HP-41 calculator emulator is available for Windows, Linux, Palm, and Pocket-PC platforms. It’s a great way to gain access to all the software stored in emulated ROM modules.

Also, the emulated ROM module, saved as a binary file, is the end point for the other two forms of code since source or assembler code will ultimately need to be located to a ROM address and built into a binary footprint suitable for placement onto ROM modules or EPROMs as is the case here.

Two types of ROM module are of interest to me:

  • The first use case is a ROM module I already have. In this case I can compare function access with test cases on the real device and on the emulated ROM using the HHP-16K EPROM Emulator.
  • The second use case would be to use ROM images that cannot be simulated on a virtual HP-41 Emulator. These ROMs would include the HP Service Diagnostic ROM, an HP-IL network diagnostic ROM, or a support ROM for communication services like the ZENROM that are rare finds (and expensive) to buy for a HP-41 calculator.

MOD File Format
Go to Warren Furlow’s web site and download a selected ROM module: Stat Pac

Extracting the zip file’s contents leaves one file named STAT.MOD. The .mod file format is a custom binary image file format created by Warren Furlow as a way to extract the contents of physical HP ROM modules for reuse in his great HP-41 emulator.

ROM File Format
Convert the STAT.MODfile into a binary image consisting of two 8-bit bytes for each 10-bit HP-calculator word using Warren Furlow’s MODFile.exe program. Get this MS-DOS or Windows program as a free download.

The result is a new file STAT.ROMand a text file STAT.TXT. The .ROM image is now in a binary form that EPROM burners can use. But the format is still not suitable for our HHP-16K as the upper 2 bits of the 10-bit word are stored in an 8-bit byte (the upper 6 bits wasted) format. The .TXT file is useful as a way to insure that the ROM module will work in our HHP-16K unit.

Listing 1: STAT-I HP ROM Module Structure

code=text
  1.  
  2. FILE NAME: C:\msdosenv\hp41\MODFile\STAT.MOD
  3. FILE FORMAT: MOD1
  4. TITLE: Stat Pac
  5. VERSION: B
  6. PART NUMBER: 00041-15002
  7. AUTHOR: Hewlett-Packard
  8. COPYRIGHT (c) Hewlett-Packard
  9. LICENSE: Hewlett-Packard Company makes no warranty as to the accuracy or completeness of the foregoing information and hereby disclaims any responsibility therefore.
  10. COMMENTS:
  11. CATEGORY: HP Application PAC
  12. HARDWARE: None
  13. MEMORY MODULES: 0
  14. EXENDED MEMORY MODULES: 0
  15. ORIGINAL: Yes – unaltered
  16. APPLICATION AUTO UPDATE: No – do not update this file
  17. NUMBER OF PAGES: 1
  18.  
  19. ROM NAME: Stat-1B
  20. ROM ID: ST1B
  21. PAGE: May be in more than one location
  22. POSITION: Any page 8-F
  23. PAGE GROUP: 0 – not grouped
  24. BANK: 1
  25. BANK GROUP: 0 – not grouped
  26. RAM: No
  27. Write Protected: No or Not Applicable
  28. FAT: Yes
  29. XROM: 2
  30. FCNS: 30
  31. XROM  Addr Function    Type
  32. 02,00 0FD4 STAT 1B     4K MCODE Programmable
  33. 02,01 0042             USER CODE
  34. 02,02 0076             USER CODE
  35. 02,03 00D4             USER CODE
  36. 02,04 01A1             USER CODE
  37. 02,05 01D4             USER CODE
  38. 02,06 01FB             USER CODE
  39. 02,07 0273             USER CODE
  40. 02,08 02C9             USER CODE
  41. 02,09 0395             USER CODE
  42. 02,10 047B             USER CODE
  43. 02,11 0620             USER CODE
  44. 02,12 0630             USER CODE
  45. 02,13 0640             USER CODE
  46. 02,14 0650             USER CODE
  47. 02,15 0710             USER CODE
  48. 02,16 072D             USER CODE
  49. 02,17 0748             USER CODE
  50. 02,18 0763             USER CODE
  51. 02,19 0B58             USER CODE
  52. 02,20 0B71             USER CODE
  53. 02,21 0C25             USER CODE
  54. 02,22 0C6D             USER CODE
  55. 02,23 0CB8             USER CODE
  56. 02,24 0CCF             USER CODE
  57. 02,25 0D9C             USER CODE
  58. 02,26 0DF7             USER CODE
  59. 02,27 0F3E             USER CODE
  60. 02,28 029E             USER CODE
  61. 02,29 02AD             USER CODE
  62. INTERRPUT VECTORS:
  63. Pause loop:                      000
  64. Main running loop:               000
  65. Deep sleep wake up, no key down: 000
  66. Off:                             000
  67. I/O service:                     000
  68. Deep sleep wake up:              000
  69. Cold start:                      000
  70. CHECKSUM: 2F1 (CORRECT)
  71.  

Note that the flag for RAM is set to No (line 26 in listing 1 above). Some HP-41 ROM modules include RAM for special operations. If RAM is being used, our simple HHP-16K EPROM Emulator will fail unless we modify either the source code or the EPROM Emulator. Also note that the ROM page and position fields show that our EPROM Emulator can support this module interfaced to any HP-41 ROM bay.

STAT.41L and STAT.41U File Formats
Now we can use our STAT.ROM file as an input to a utility bundled with HP’s own Software Development System (SDS-II, released in 1986) for MS-DOS computers called IGHLOW.EXE. The HIGHLOW.EXE program expects the .ROM image to have a file name ending with .41R. So I make a copy of STAT.ROM and save it with the new name STAT.41R. This is the only bridge needed between Warren Furlow’s after-market software emulator tools and HP’s original SDS-II software tools. Neat. The HIGHLOW.EXE program converts the two 8-bit bytes of the HP-41 executable code into 8-bit bytes for lower 8-bits of the HP41 word and 4 packed 2-bit chunks for the upper 2 bits of the HP41 10-bit word. The SDS-II document points out that this is the format we need for Hand-Held Products EPROM Emulators.

Now we have two files suitable for our EPROM Burner:

  • STAT.41L for 1/2 of one of our two 2764K EPROMs
  • STAT.41U for 1/4 of the 2732K EPROM

(Remember I am using these chips because I have them on hand, so I will leave the remainder of EPROM memory filled with 0xFF values just as the UV erase lamp left them.)

Listing 2: STAT-I HP ROM Module Software Files

code=text
  1.  
  2. C:\msdosenv\hp41\MODFile>dir
  3.  Volume in drive C is Ron
  4.  Volume Serial Number is 08DE-9633
  5.  
  6.  Directory of C:\msdosenv\hp41\MODFile
  7.  
  8. 09/22/2007  05:54 PM    <dir>          .
  9. 09/22/2007  05:54 PM    </dir><dir>          ..
  10. 04/07/1988  06:33 PM            16,489 HIGHLOW.EXE
  11. 09/20/2007  12:19 PM            61,440 MODFile.exe
  12. 09/20/2007  12:19 PM            61,440 MODFileWin.exe
  13. 09/20/2007  12:19 PM               282 Readme.txt
  14. 09/20/2007  12:26 PM             8,192 Stat-1B.ROM
  15. 09/22/2007  05:54 PM             4,096 STAT.41L
  16. 09/20/2007  12:26 PM             8,192 stat.41R
  17. 09/22/2007  05:54 PM             1,024 STAT.41U
  18. 02/24/2004  06:09 PM             5,917 STAT.MOD
  19. 09/20/2007  12:24 PM             2,166 STAT.txt
  20.               10 File(s)        169,238 bytes
  21.                2 Dir(s)  118,975,586,304 bytes free
  22. </dir>

I use a Needhan Electronic’s EPROM burner and MS-DOS tools to massage ROM coded files and burn EPROMs. Because the interface requires a Centronics printer port, I use an Ampro Pentium II board with CIFS/SMB Ethernet connected to my main computer to drive the burner. I use a Walling Co. UV lamp assembly for erasing code previously stored in EPROM chips. Needham has a chip selector search engine online for their burners here.

Figure 8: EPROM Needham Burner and Walling UV Lamp

EMP10 EPROM Burner and UV Eraser

Using Programs Loaded in HHP-16K

tbd…

HHP-16K in the Marketplace

The Canadian Infantry used the HP-41CV and HHP-16K as part of their mortar firing training course.

Figure 9: Canadian Infantry HHP-16K Mortar Firing Training Application

Canadian Infantry HHP-16K Mortar Firing Training Application
In the figure above, the HHP-16K is located in the lower left.

The entire document titled “LAND FORCE INFANTRY INSTRUMENTS FOR CALCULATING MORTAR FIRING DATA” is online here.

The document discusses a few user tricks with the HHP-16K, such as how to determine key assignments associated with functions loaded on the HHP’s 3 EPROMs – page 16 (page 28 of 259 in the PDF).

Next steps…

I invite others to post their comments, online links, or other suggestions, so we can ALL continue to learn more about this device, the software it supported, and the business development model it represents today!

Technorati Tags: , , , , , , , , , , , , , , , , ,

4 Responses to “An Introduction to the HHP-16K EPROM Emulator”

  1. play mp3 Says:

    Hello, nice post. Bookmark it.

  2. Ticket 4 SuperBowl Says:

    Hi the comment is delightful.
    I like your blog..
    Regards

  3. Gerry Schultz Says:

    Ron:

    I bought an HHP-16K back in the early 80s and still have it along with the original documentation, such as it is. I was looking for information on my old unit as it came with EPROMs that has software still burned in. I think it’s HP-41’s diagnostic software but I don’t have any informaton on that. When I went to HHC 2008 last year, I met someone who was familiar with 41C’s diagnostic software but I didn’t bring the HHP-16K. This year, I will bring it to HHC-2009 at Ft. Collins Co. Will you be attending this conference as it’s the 30th birthday celebration of the HP-41?

    Please email me and let me know. Your article is very good. In the documentation I have, it goes into setting the switches and some other stuff. I don’t have it in front of me as it’s at home. Would you like a copy? I assume so, if you don’t have it already.

    Gerry

  4. Zoomable Photo Example | LectureMaker, LLC Says:

    […] I made a photographic engineering study around this particular unit on the Embedded Components blog site: An Introduction to the HHP-16K EPROM Emulator […]

Leave a Reply

What is 11 + 14 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)