Electronics
Reviews
Electronic
Projects
Electric
R/C Planes
General
Aviation
Hammond
Organs
Calculator
Collection
Slide Rule
Collection

  
HP-19C Programmable Calculator

When my HP-42S broke down in 1998, one of my colleagues (also my former grad supervisor) gave me his broken HP-41CX and HP-19C. I described how I repaired the 41CX in another article. Here we'll take a look at the 19C.

The HP-19C was one of a matched pair of high-end programmables in HP's "20 Series" of calculators. The 19C was the printing version of the 29C, which in turn was an improvement over the similar looking 25C. With the exception of the printing functions, the 19C and 29C shared the same keys, although in a different arrangement.

The programming capabilities of the 19C (and 29C) were impressive, with space for 98 fully merged keystrokes, and 30 memory registers. Although these calculators lacked a card reader for permanent storage, both had continueous memory that would retain the most recently entered program and 16 of the 30 registers even when the calculator was turned off (a feature taken for granted today).

  
This calculator, in addition to offering a full suite of scientific and statistical functions, had very powerful programming constructs. There were eight different conditional tests (four x versus y and four x versus 0), increment and decrement instructions, three levels of subroutines, and indirect addressing of both registers and branch targets. Branching was done using labels, but indirect branching also supported relative jumps. Program editing was made easy by automatic insertion, and a DEL key.

At the time that this calculator was new, I was thirteen years old and had never heard of HP calculators. Instead, I had a Commodore PR100 with 72 unmerged program steps and 10 memories, which falls far short of what the 19C can do. Of course, the Commodore cost far less as well, and I spent hundreds of enjoyable hours writing programs for it.

   The back label contains a list of useful conversion factors.
The back label contains a list of useful conversion factors.
Now, thirty years later, the HP-19C is the calculator I use most often. It sits on my desk at work, and gets used several times a day for quick calculations. I've also written an equation solver program for it, which is reproduced at the end of this article.

Repairs

As I mentioned in the introduction, my HP-19C required some repairs when I first received it. It needed a new battery pack, the keyboard had become unplugged from the main CPU board, and the tabs on the battery cover were damaged (almost broken off).

I fashioned a new battery pack out of 1100mAh Sanyo NiCd cells. These were state-of-the-art in 1998, and had far more capacity than the original HP battery pack (which I think was 250mAh). Rather than rely on pressure to maintain a connection with the battery contacts, I soldered the battery pack leads directly to the terminals in the calculator.

My home-made 1100mAh 4.8V battery with leads soldered in place.   
My home-made 1100mAh 4.8V battery with leads soldered in place.
This calculator was really designed to be disassembled. The back cover comes off after removing a few screws, and the various sub-assemblies inside just plug together. When I received the calculator, the keyboard wasn't properly plugged into the main board (the result of an earlier repair attempt), but it was a simple matter to align the pins and put it back together.

The battery compartment cover has small tabs that hold the cover in place. These were almost broken off by someone attempting to force the cover closed. I repaired these by carefully straightening them, and then running a hot soldering iron along the crease to soften the plastic. The tabs are not as strong as they once were, but they are fairly solid. A piece of foam rubber on the opposite end of the cover keeps it securely in place.

What About the Printer?

The printer on my HP-19C sort of works, except for two problems: two of the print element dots are cracked, and I can't get any paper for it anyway. I cut some appropriately narrow strips of paper from a roll of thermal fax paper to test the printer, and noticed two rows of dots missing. Upon disassembling the printer, hoping to find a loose connection, I discovered cracks in two of the print head's heating elements. Testing with an Ohm-meter confirmed that these were open-circuit. But even without the printer, this makes a nice desktop scientific calculator, and it's the one I keep on my desk at the office.

An Equation Solving Program

One feature of the HP-42S that I missed was the equation solver, so I set out to write a simple one for the 19C. I submitted it to the Museum of HP Calculators, and it now appears in their software library. I've also reproduced it here.

The HP-42S has a solver where you can provide a program for an equation of n variables, fix any n-1 of these variables, and solve for the remaining one, so I wanted mine to have the same flexibility.

My solver uses the secant method, in which the two most recent guesses are used to define a line. The point where the line intercepts the x-axis is used as the next guess. When two consecutive guesses are the same, the solution has been found. I'm sure this solver is not as good as the one in the HP-42S, but it works sufficiently well for my purposes. It can get into an infinite loop on periodic functions, like sin(x).

Usage

Using the solver is simple. First, rearrange your equation so all the terms are on the left hand side. In other words, rewrite it in the form f(a1,...,an) = 0.

Next, enter the left hand side as a subroutine with label 9. The variables are represented by the like-numbered registers (i.e. a1 is in register 1, and so on).

To solve for any one variable, store values for all the other variables in the appropriate registers, enter two initial guesses for the variable you wish to solve for, enter the variable number, and press GSB 0.

See the sample problem for more details.

Program Listing

LineInstructionComments
001♦  LBL 0 Main entry point
002 STO 0 Store index of variable to solve for
003 R↓  
004 STO .2 Store second guess
005 R↓  
006 STO .1 Store first guess
007 STO i Compute f1 = f(R1,..,Ri1,..,Rn)
008 GSB 9  
009 STO .0  
010 RCL .2 Compute f2 = f(R1,..,Ri2,..,Rn)
011 STO i  
012♦  LBL 1  
013 GSB 9  
014 STO .2  
015 RCL .1 Compute new Ri2 = (Ri1 f2 - Ri2 f1) / (f2 - f1)
016 ×  
017 RCL i  
018 STO .1 Move old Ri2 to Ri1 while we're here
019 RCL .0  
020 ×  
021 −  
022 RCL .0  
023 RCL .2  
024 STO .0 Move old f2 to f1 while we're here
025 x↔y  
026 −  
027 ÷  
028 STO i Save new value for Ri2
029 RCL .1 Compare to previous guess
030 x≠y? Keep going until they're the same
031 GTO 1  
032 RTN  

Registers

RegisterUse
 0 Index i of variable to solve for
 1-9 Variables to solve for (up to 9)
 .0 Previous value for f(R1,..,Rn)
 .1 Previous value of Ri
 .2 Second guess during initialization. Current value for f(R1,..,Rn) during main loop

Sample Problem

The net resistance, R3, of two parallel resistors of resistance R1 and R2 is given by:

R3

 = 

R1 R2
-------------
R1 + R2

This can be rewritten in the form f(R1,R2,R3) = 0 as follows:

R1 R2  - 

R3

 = 

0

-------------
R1 + R2

The following subroutine implements this equation:

LineInstructionComments
033♦  LBL 9 Solver uses subroutine with label 9
034 RCL 1  
035 RCL 2  
036 ×  
037 RCL 1  
038 RCL 2  
039 +  
040 ÷  
041 RCL 3  
042 −  
043 RTN  

What is the resistance of a 5kΩ and 10kΩ resistor in parallel?

DescriptionKeystrokesDisplay
Store 5 in R1 5 STO 1   5.0000  
Store 10 in R2 10 STO 2   10.0000  
First guess is 3 3 ENTER   3.0000  
Second guess is 4 4 ENTER   4.0000  
Solve for R3  3 GSB 0   3.3333  

The answer is 3.3333kΩ. What resistance is needed in parallel with a 10kΩ resistor to give a 2kΩ parallel resistance?

DescriptionKeystrokesDisplay
Store 2 in R3 (R2 is still 10 from the previous problem) 2 STO 3   2.0000  
First guess is 3 3 ENTER   3.0000  
Second guess is 4 4 ENTER   4.0000  
Solve for R1  1 GSB 0   2.5000  

The answer is 2.5kΩ. If the program cannot find a solution, it will eventually end up dividing by zero, which will display Error. For example, what resistance is needed in parallel with a 10kΩ resistor to give a 12kΩ parallel resistance?

DescriptionKeystrokesDisplay
Store 2 in R3 (R2 is still 10 from the previous problem) 12 STO 3   2.0000  
First guess is 3 3 ENTER   3.0000  
Second guess is 4 4 ENTER   4.0000  
Solve for R1  1 GSB 0   Error  

It's not possible to put something in parallel with a 10kΩ resistor and end up with a higher resistance.

 

 

 
Buy Stefan a coffee! If you've found this article
useful, consider leaving a donation to help support
stefanv.com

 
Last updated Friday July 23, 2010. E-mail Stefan

 

Disclaimer: Although every effort has been made to ensure accuracy and reliability, the information on this web page is presented without warranty of any kind, and Stefan Vorkoetter assumes no liability for direct or consequential damages caused by its use. It is up to you, the reader, to determine the suitability of, and assume responsibility for, the use of this information.

Copyright: All materials on this web site, including the text, images, and HTML mark-up, are Copyright © 2010 by Stefan Vorkoetter unless otherwise noted. All rights reserved. Unauthorized duplication prohibited. You may link to this site or pages within it, but you may not link directly to images on this site, and you may not copy any material from this site to another web site or other publication without express written permission. You may make copies for your own personal use.


 


 

 

Subscribe

Subscribe to stefanv.com feed
Subscribe to stefanv.com with MY AOL
Subscribe to stefanv.com with Bloglines
Subscribe to stefanv.com with Google
Subscribe to stefanv.com with My MSN
Subscribe to stefanv.com with NewsIsFree
Subscribe to stefanv.com with newsgator
Subscribe to stefanv.com with My Yahoo!

Share