Figure 4: HPP-16K Interface Circuit Board
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. |
|
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
|
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
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
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 3” operation.
Figure 7: Capture an HHP-16K Waveform Diagram
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.MOD” file 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.ROM” and 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)
-
-
FILE NAME: C:\msdosenv\hp41\MODFile\STAT.MOD
-
FILE FORMAT: MOD1
-
TITLE: Stat Pac
-
VERSION: B
-
PART NUMBER: 00041-15002
-
AUTHOR: Hewlett-Packard
-
COPYRIGHT (c) Hewlett-Packard
-
LICENSE: Hewlett-Packard Company makes no warranty as to the accuracy or completeness of the foregoing information and hereby disclaims any responsibility therefore.
-
COMMENTS:
-
CATEGORY: HP Application PAC
-
HARDWARE: None
-
MEMORY MODULES: 0
-
EXENDED MEMORY MODULES: 0
-
ORIGINAL: Yes – unaltered
-
APPLICATION AUTO UPDATE: No – do not update this file
-
NUMBER OF PAGES: 1
-
-
ROM NAME: Stat-1B
-
ROM ID: ST1B
-
PAGE: May be in more than one location
-
POSITION: Any page 8-F
-
PAGE GROUP: 0 – not grouped
-
BANK: 1
-
BANK GROUP: 0 – not grouped
-
RAM: No
-
Write Protected: No or Not Applicable
-
FAT: Yes
-
XROM: 2
-
FCNS: 30
-
XROM Addr Function Type
-
02,00 0FD4 STAT 1B 4K MCODE Programmable
-
02,01 0042 USER CODE
-
02,02 0076 USER CODE
-
02,03 00D4 USER CODE
-
02,04 01A1 USER CODE
-
02,05 01D4 USER CODE
-
02,06 01FB USER CODE
-
02,07 0273 USER CODE
-
02,08 02C9 USER CODE
-
02,09 0395 USER CODE
-
02,10 047B USER CODE
-
02,11 0620 USER CODE
-
02,12 0630 USER CODE
-
02,13 0640 USER CODE
-
02,14 0650 USER CODE
-
02,15 0710 USER CODE
-
02,16 072D USER CODE
-
02,17 0748 USER CODE
-
02,18 0763 USER CODE
-
02,19 0B58 USER CODE
-
02,20 0B71 USER CODE
-
02,21 0C25 USER CODE
-
02,22 0C6D USER CODE
-
02,23 0CB8 USER CODE
-
02,24 0CCF USER CODE
-
02,25 0D9C USER CODE
-
02,26 0DF7 USER CODE
-
02,27 0F3E USER CODE
-
02,28 029E USER CODE
-
02,29 02AD USER CODE
-
INTERRPUT VECTORS:
-
Pause loop: 000
-
Main running loop: 000
-
Deep sleep wake up, no key down: 000
-
Off: 000
-
I/O service: 000
-
Deep sleep wake up: 000
-
Cold start: 000
-
CHECKSUM: 2F1 (CORRECT)
-
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 “HIGHLOW.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)
-
-
C:\msdosenv\hp41\MODFile>dir
-
Volume in drive C is Ron
-
Volume Serial Number is 08DE-9633
-
-
Directory of C:\msdosenv\hp41\MODFile
-
-
09/22/2007 05:54 PM <DIR> .
-
09/22/2007 05:54 PM <DIR> ..
-
04/07/1988 06:33 PM 16,489 HIGHLOW.EXE
-
09/20/2007 12:19 PM 61,440 MODFile.exe
-
09/20/2007 12:19 PM 61,440 MODFileWin.exe
-
09/20/2007 12:19 PM 282 Readme.txt
-
09/20/2007 12:26 PM 8,192 Stat-1B.ROM
-
09/22/2007 05:54 PM 4,096 STAT.41L
-
09/20/2007 12:26 PM 8,192 stat.41R
-
09/22/2007 05:54 PM 1,024 STAT.41U
-
02/24/2004 06:09 PM 5,917 STAT.MOD
-
09/20/2007 12:24 PM 2,166 STAT.txt
-
10 File(s) 169,238 bytes
-
2 Dir(s) 118,975,586,304 bytes free
-
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
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 tbd: EPROM Needham Burner and Walling UV Lamp
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: Ron Fredericks, Community, Software, Engineering, Projects, Embedded Device, Personal Programmable Calculator, The Museum of HP Calculators, Jim De Arras, EPROM, HHP-16K, Hand Held Products, Emulator, Compiler, Decompiler, HP-41, Logic Analyzer, DMM
This entry was posted
on Sunday, September 9th, 2007 at 11:23 pm and is filed under Component Projects, HP-41 Personal Portable Computing.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
Leave a Reply