Hacker News new | past | comments | ask | show | jobs | submit login
The Strange Case of the Rogue HP-12c Calculator (dm319.github.io)
117 points by dm319 5 days ago | hide | past | favorite | 32 comments





Looks like an HP calculator forum got to the bottom of this around a month ago. The company HP licensed their calculator production to accidentally shipped a run of units with buggy firmware. Most have been captured and flashed with corrected firmware. Some distributors were unwilling to return their calculators for rework, which is how these ended up in the hands of customers. Anyone with a buggy calculator should contact HP calculator support for a replacement. https://www.hpmuseum.org/forum/thread-21965-post-190853.html...

What's the source of the buggy firmware though, it looks like the TVM algorithm was rewritten, a rewrite is not really a bug

HP's Voyager calculators originally ran on custom silicon-on-sapphire chips (which gave them extremely long battery life). After these stopped production, HP changed the calculator design to use an off-the-shelf microcontroller that runs the original firmware in an emulator. This reduces the battery life, but the emulator runs the firmware 60-90 times faster than the original calculators. This is baseless speculation, but I imagine what happened was that they either tried switching microcontrollers or otherwise updated the emulator and introduced an emulation bug that gets exposed by the calculation in the blog post.

Do such long-battery-life silicon-on-sapphire chips (or an alternative) still get produced anywhere today, or is this a lost technology and we have to make do with less battery life now?

Not to my knowledge. But new processors solve the problem differently, by running active code very fast on very small feature size lithography, and then entering deep sleep to achieve really low duty cycles. They do really well, achieving impressive numbers of microwatts per MHz:

https://www.eembc.org/ulpmark/ulp-cp/scores.php

I expect that if you wrote code using the power management features of modern platforms, you'd blow that sapphire process on an obsolete node size out of the water.

No idea whether a modern node size on that low-leakage substrate would be any better if it existed...


Or, they wanted to drop the emulation and tried to rewrite the FW to run natively on the microcontroller.

Would collectors drool over something like this? Is it like misprinted currency or a rare misstamped coin?

I wish more was spent on trying to verify the authenticity of the hardware, or contacting HP for comment. The simplest explanation is that a distributor in Brazil sourced counterfeit hardware. Authenticatic hardware shipping with some bespoke and defective firmware seems even less likely than simple counterfeiting.

> Authenticatic hardware shipping with some bespoke and defective firmware seems even less likely than simple counterfeiting.

It's not as unlikely as you would think. Electronic counterfeiters are often just ghost shifts at contract manufacturers. If a single company is handling the injection molding, PCB, and assembly, they can run a secret shift that makes units for them to sell themselves. Even if they can't get ahold of all the surplus parts they need, they can design their own.

Since the firmware is different, HP could have also outsourced production maintenance too (i.e. updating firmware if a chip reaches end of life and needs to be replaced with something that's not exactly compatible) which isn't unheard of for legacy products that no one wants to deal with.


Wikipedia says There were at least nine hardware revisions of the HP-12C since 1981 (including one special issue)

Wikipedia has a lot of info. I'd like to know the serial numbers of the defective units.

https://en.wikipedia.org/wiki/HP-12C


>Authenticatic hardware shipping with some bespoke and defective firmware seems even less likely than simple counterfeiting.

One possible hypothesis is that HP switched to a new SoC, due to price or availability, and porting the firmware introduced some bugs.


Since it is much used in finance, having it give the wrong answers could be very rewarding money-wise if placed in the wrong ("right") hands. I know someone very successful in finance who had the 12c as his constant companion.

Far-fetched but interesting possibility.


The article mentions getting replacements from HP which exhibited the same behavior.

Cracking it open to examine the board might be helpful.

> The simplest explanation is that a distributor in Brazil sourced counterfeit hardware.

I wouldn't call this the simplest explanation. While they a vastly overpriced produce in 2024, its a niche product and I doubt sales are high. The simplest explanation an engineer was told to update the firmware and it had a side effect on the TVM function.


Unfortunately no trig functions, or this would've been useful: https://www.rskey.org/~mwsebastian/miscprj/models.htm

But running this may be possible: https://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.c...


Wikipedia says there are several clones of the HP 12c in Brasil. They look not 100% the same but cost much less. So maybe someone make HP look-like models and sell they with for a much better price.

HP did license out the manufacture of 12cs at some point so if it's not a counterfeit it is almost certainly a manufacturing error by some licensee. Note that the 12-c is one of a legendary "voyager" series of HP calculators which have that landscape form factor and are highly prized by collectors. There is an HP15-C scientific calculator equivalent and a 16-C which is supposed to be for programmers so does the sorts of things we programmers do all the time like converting things from hex to octal etc. It has built-in support for bit twiddling and shifting operations too. If you ever see a landscape-style "voyager" HP calculator in a junk shop or whatever and it's not a 12-C (because they are quite common) it's quite rare and may be worth buying and reselling if it's in usable condition.

I have 2 HP-12c calculators which I bought while I worked at Goldman. One was always on my desk at work and I had another at home. I can certainly confirm they were common in finance back in 2000-2009ish. That said even back then they were being replaced by non-RPN calculators for a lot of people and only people with nostalgia and the hardcore had a 12c.

They're incredibly robust - famously a zookeeper once used an HP12-c to calculate proportions for animal feed, dropped it into the mix and it passed through the digestive tract of a hippo. It was still able to calculate the yield to maturity of a bond after cleaning.

In addition their batteries last forever. Even though the versions I have use the "weak" newer battery tech[1] they are both still on their original batteries and as I say mine are about 20 years old and at one point I used one of them every day. Having a slow cpu means they just run forever.

I now additionally own two other RPN calculators which I bought because I needed a scientific calculator and have a nostalgia for HP calculators because I used to write little programs for my dad on his. The 12c and the like don't have trig functions in particular so I own an HP35s and a swissmicros DM42[2], which is essentially an HP42S emulator with a faster processor and some enhanced capabilities based on Thomas Okken's "Free42"[3]. I would strongly recommend the DM42 for anyone who likes HP-style RPN calculators and wants a more powerful version. It's a fabulous calculator. Pretty much the only way the HPs are better is the feel of the keys which is too stiff on the DM42.

The HP35s is a great calculator also. Not as powerful as the DM42 but with that lovely classic HP key feel and a bit more usability for some things at the expense of being much worse to program, much slower and only having a 2-line screen. It does have a nice built-in set of physical constants though (which I never use).

[1] The original battery tech uses some sort of legendary toxic battery that is no longer permitted due to hazardous chemical regulations.

[2] https://www.swissmicros.com/product/dm42

[3] https://thomasokken.com/free42/


The original battery tech uses some sort of legendary toxic battery that is no longer permitted due to hazardous chemical regulations.

Alkaline button batteries used to contain mercury, which has been phased out in the last 20-25 years. The original Voyager line used 3 x LR44 (alkaline), but even then you could have replaced them with their less toxic silver-oxide equivalents. Today's LR44 cells are mercury-free.

Later iterations of HP12C use 2 x CR2032, not because of any concerns about toxicity -- the 2032s were equally toxic -- but, I suspect, because the original battery controller was all custom HP silicon in some funky semi-analog process, which couldn't survive when HP, along with the rest of the industry, fully succumbed to cost-cutting disease. Everything possible in the new calculators if off-the-shelf.


The original Voyager line used silicon-on-sapphire chips, which are extremely energy efficient. My 1987 vintage HP-15C is only on its third set of batteries. When they changed to a conventional CMOS process and emulated the original CPU on top of an ARM microcontroller the power drain went up.

I still use my two vintage 15Cs for simple calculations on a regular basis, and change the batteries every decade or so.

To be fair, lack of self-discharge in the battery chemistry has a lot to do with the long battery life; you can actually drain the batteries fairly quickly with long-running calculations.


I've had other HPs (28C, 48SX, 48GX, 33S, 35S, 49G, 50G, Prime) but the 15C is the one I keep returning to, as anything more powerful really should be handled on a computer CAS like Mathics or Matlab-like environment like Octave instead.

LR and CR cells don't contain mercury and never have. The original 12c battery was a MR44. 'L' is manganese alkaline, 'C' is lithium, 'M' is mercury.

All those cells have a zinc anode, which used to be amalgamated with a small amount of mercury to prevent corrosion and leakage[1]. (Mercuric oxide batteries certainly contain even more.)

[1] https://www.epa.gov/mercury/mercury-batteries


I wonder how the NPV algo is done.

Prima facia, the way Id tackle it if I have a few extra registers is

1. Id write the exponent as n = R*m, where R is an integer. R = 2 is probably best.

2. Then Id do pascal's triangle (every element is a simple combination comb[x,y]) for the expansion of the exponent (if R = 2 binomial expansion) and add in ascending order.

3. Then raise the answer to the power of m.

Of course, I can iteratively do steps 1-2 if the interest rate is very small.


Here's an HP article on the HP-80, a predecessor to the 12C. They describe an algorithm solving for interest rate: https://www.worldradiohistory.com/Archive-Company-Publicatio...

Was it not known since the 70s that you should never ever use floats for currency? Why would any sane person build a financial calculator using floats?

HP calculators use BCD not floats.

Over my thirty some years of software development, I've witnessed many new entrants to the field not being aware of certain fundamentals learned long ago. I would theorize it's going to become more and more likely as patience for acquiring a deeper understanding, in general, among engineers I work with now seems to be at an all time low. Now-a-days it seems the move fast and break things mentality has taken over.

This aroused my interest:

> describing some difficulty changing the decimal point to a decimal comma on a new Brazilian-bought HP-12c

Perhaps some wrong constant has been put in the firmware as a result of mixing up the command and period.


Interesting, because a normal HP-12C it's very easy to change between decimal comma and decimal point. With the calculator off you just hold down "." and turn it on and it will toggle between decimal point and decimal comma for display. I just tried it on one of mine and (while not Brazilian) it does work as it should.

Just confirmed it on a Brazilian 12C (CNA 81306005) and it worked as expected. It's a CR2032 one, so it's CMOS.

One thing comes to mind though: back when this calculator was acquired (my wife was doing her MBA) a professor warned about being tempted to buy the Platinum version, as it would yield wrong results and, if that happened in a test, it'd result in the student failing. I think that, back then, the Platinum was the first to run on ARM emulation.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: