Post Reply 
Suggestions on HP21 restoration
04-09-2022, 05:13 PM
Post: #1
Suggestions on HP21 restoration
I would like to ask for suggestions on how to restore an HP21 which has ruined electronics, but great housing and keys. I plan to use an Arduino (or similar) and a dot matrix OLED display to replace the guts.

I know the obvious way is to reproduce HP21 behaviour, which is not too hard. However, the hardware I plan to use will be capable of much more, and the LCD will also be able to display much richer info, so I would like to ask for ideas on what I can improve on the standard HP21 functionality, taking advantage of the powerful hardware.

My main concern lies on the keys: I want to respect key markings / functions. For example: HP21 has only one shift key. I can't add a second shift key, because I simply don't have any spare keys. All I have are the original HP21 keys, with their original markings/functions. This limits my possibilities, and I'm out of ideas on how to deal with that.

That would be perfect to, for example, turn it into a 42s, 34c, or 15c, but the HP21 keyboard won't fit these models. Any ideas on how to handle that?

Thanks in advance!
Find all posts by this user
Quote this message in a reply
04-09-2022, 05:24 PM
Post: #2
RE: Suggestions on HP21 restoration
Hello!

(04-09-2022 05:13 PM)Marcovecchio Wrote:  Any ideas on how to handle that?

Before re-inventing any wheels you might - if you did not already - want to take a look at Panamatik's "Woodstock Low Power" upgrade: http://www.panamatik.de/html/hp_low_power.html

It is not exactly what you have in mind (you write about a multiline display) but comes close in many other respects, especially in the way it is able to emulate many different calculators.

Only recently we had another thread dealing with an Arduino based recreation of an HP-25 (in one of the other subforums). It was discovered that the 32 bit calculations of the Arduino Nano/Uno and Mega are not good enough to reproduce the precision of the HP calculator. So you will need an Arduino Due (which is way too big to fit into this calculator) or another 64 bit capable microcontroller.

Regards
Max
Find all posts by this user
Quote this message in a reply
04-09-2022, 05:47 PM
Post: #3
RE: Suggestions on HP21 restoration
Thanks for the heads up on Panamatik's kit, but if I understand it correctly, the bubble led display is needed, but my HP21 has no LEDs anymore, someone else removed it. I have only the housing and keys, nothing else.. well, the original PCBs are there, but all corroded by battery leakage.

Regarding precision, thanks again, I didn't know about this! It seems I have another problem to solve, in addition to the limited key functions.

By the way, back to Panamatik's kit: it emulates several models in a Woodstock calculator. But how does it deal with different keyboards? Are the markings just ignored, and the emulation gives each key the function based on key position on the layout? That's it?

Other than that, I can't see how to emulate an HP34c on a HP25.
Find all posts by this user
Quote this message in a reply
04-09-2022, 06:21 PM
Post: #4
RE: Suggestions on HP21 restoration
(04-09-2022 05:47 PM)Marcovecchio Wrote:  By the way, back to Panamatik's kit: it emulates several models in a Woodstock calculator. But how does it deal with different keyboards? Are the markings just ignored, and the emulation gives each key the function based on key position on the layout? That's it?

Other than that, I can't see how to emulate an HP34c on a HP25.

Panamatik offers stick-on labels for the various other models (both for keys and the surrounding bezel). These work quite well if you will use this rarely or even occasional use, but with frequent use, they start to wear and begin to peel off.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
04-10-2022, 12:18 AM
Post: #5
RE: Suggestions on HP21 restoration
rprosperi Wrote:  Panamatik offers stick-on labels for the various other models (both for keys and the surrounding bezel). These work quite well if you will use this rarely or even occasional use, but with frequent use, they start to wear and begin to peel off.

Thank you, Bob! Now it makes much more sense to me. Smile
Find all posts by this user
Quote this message in a reply
04-10-2022, 04:20 AM
Post: #6
RE: Suggestions on HP21 restoration
You might want to look at the Raspberry Pi Pico, which is a more powerful sort of Arduino. There's more flash, more RAM, more power in the ARM core and two cores. It is also cheap and fairly small. You can also use Eclipse for source level debug out of the box. i used it to replace the insides of the Psion organiser 2:

https://youtu.be/bD-tpxNDMsI

If there's not enough space for a Pico, then you can get the RP2020 chip on it's own and use that in a small form factor (it's a fiddle bit of soldering but you can do it). I did this with a datapack for the Psion:

https://youtu.be/NsxZ0bjGaOU.

there's also the STM32 series of chips, which can do this job. i used the Arduino framework to program these and do a couple of 'insides replacements':

https://youtu.be/IKQccZCiaoQ
https://youtu.be/WuV8q2h9zoU

I stopped using these chips as they became difficult to buy (no such problem with the RP2040, not yet anyway). It's nice having the source level debug too, which is trickier on the Arduino platform, maybe. You can also program the STM32 using 'bare metal'.

Hope that gives you some ideas...

Andrew
Find all posts by this user
Quote this message in a reply
04-10-2022, 04:50 AM
Post: #7
RE: Suggestions on HP21 restoration
(04-09-2022 05:13 PM)Marcovecchio Wrote:  For example: HP21 has only one shift key. I can't add a second shift key, because I simply don't have any spare keys.

I’m probably stating the obvious but anyway… Two presses of the shift key could serve as a second shift.
Find all posts by this user
Quote this message in a reply
04-10-2022, 09:35 AM
Post: #8
RE: Suggestions on HP21 restoration
Very nice projects Andrew - the RP2040 is cheap, small, powerful, and available!

For the original question
- perhaps use a combination like shift-DSP to bring up a menu, using the 4 function keys on the top row
- perhaps use long-press as a way to get another function on a key
Find all posts by this user
Quote this message in a reply
04-10-2022, 04:18 PM
Post: #9
RE: Suggestions on HP21 restoration
Thank you vaklaff and EdS2, these are great ideas! Since I'll be using a 256x32 display, I'm free to add many annunciators, so double press shift and other kinds of shifting may work very well, thanks!

Also, turning the top row into soft keys for the menu would be great! Very similar to the hp42s.
Find all posts by this user
Quote this message in a reply
04-10-2022, 04:38 PM
Post: #10
RE: Suggestions on HP21 restoration
Blackjetrock, many many thanks for all the suggestions and videos. I have a lot to learn from you! You are already a master at the kind of project I'll attempt.

I think I already have a STM32 prototype board somewhere here, and it's small enough to fit the HP21 housing. I'll try it first, but I'll also consider the other options you mentioned, thanks!
Find all posts by this user
Quote this message in a reply
04-10-2022, 06:16 PM
Post: #11
RE: Suggestions on HP21 restoration
I'm just having a bit of fun...

Fitting a display is sometimes a problem too. I have used these people quite a lot:

https://www.buydisplay.com/oled-display

They are fairly quick to supply and seem reliable. the displays are nice too.
Despite the low power claims I'd steer clear of epaper/eink displays as they take a long time to update.
On a low power theme, the RP2040 isn't particularly low power even with everything turned down. The STM32 is a bit better I think, but you do have to shut everything down.

Andrew
Find all posts by this user
Quote this message in a reply
04-11-2022, 08:24 AM
Post: #12
RE: Suggestions on HP21 restoration
I think- I hope - that the state of play with running the RP2040 at very low power consumption is something which will improve with time.

Meanwhile, there are some useful-looking links here:
pico sleep mode via micropython
Find all posts by this user
Quote this message in a reply
04-11-2022, 12:12 PM
Post: #13
RE: Suggestions on HP21 restoration
(04-11-2022 08:24 AM)EdS2 Wrote:  I think- I hope - that the state of play with running the RP2040 at very low power consumption is something which will improve with time.

Meanwhile, there are some useful-looking links here:
pico sleep mode via micropython

Hmm, I'm not so sure. the RP2040 datasheet

https://datasheets.raspberrypi.com/rp204...asheet.pdf

has the power consumption and the lowest it seems to go is 100's of uA. That's OK if running off a DC supply or a big battery but if you are trying to run off a 2032 battery with, say, 100mAh or even 200mAh then it starts to be a problem.

Maybe I'm not reading that section correctly?

Andrew
Find all posts by this user
Quote this message in a reply
04-12-2022, 07:43 AM
Post: #14
RE: Suggestions on HP21 restoration
I think you're right - it's in the milliamp range, at one volt, and that's a lot higher than other microcontrollers as used in calculators. 100 hours of standby isn't enough, although 100 hours of operation might be fine for a lot of people.

So, such a build might need an actual power switch, not a soft power switch, or need a power controller chip.

It might be that using one of the zero-power (bistable) LCDs (which continue to display even without power) would allow the microcontroller to power off, waking on any keypress, in a way which is not user detectable.

https://ghubcoder.github.io/posts/waking...l-trigger/
Find all posts by this user
Quote this message in a reply
04-12-2022, 09:23 AM
Post: #15
RE: Suggestions on HP21 restoration
(04-12-2022 07:43 AM)EdS2 Wrote:  I think you're right - it's in the milliamp range, at one volt, and that's a lot higher than other microcontrollers as used in calculators. 100 hours of standby isn't enough, although 100 hours of operation might be fine for a lot of people.

So, such a build might need an actual power switch, not a soft power switch, or need a power controller chip.

It might be that using one of the zero-power (bistable) LCDs (which continue to display even without power) would allow the microcontroller to power off, waking on any keypress, in a way which is not user detectable.

https://ghubcoder.github.io/posts/waking...l-trigger/

Yes, I think a few milliamps while operating is fine, it's just the sleep modes that are high-ish consumption. Yu could also use a FET switch to turn the power on and off so have a soft on/off circuit that way.

Andrew
Find all posts by this user
Quote this message in a reply
04-12-2022, 05:53 PM
Post: #16
RE: Suggestions on HP21 restoration
(04-09-2022 05:13 PM)Marcovecchio Wrote:  [...
...]
I know the obvious way is to reproduce HP21 behaviour, which is not too hard. However, the hardware I plan to use will be capable of much more, and the LCD will also be able to display much richer info, so I would like to ask for ideas on what I can improve on the standard HP21 functionality, taking advantage of the powerful hardware.
[...]

Hold it right there Buster!
What doth thou meanest when thy speaketh; "improve on the standard HP21 functionality"?

I call forth the Inquisitors!

B^)

10B, 10BII, 10C, 11C, 12C, 14B, 15C, 16C, 17B, 18C, 19BII, 20b, 22, 29C, 35, 38G, 39G, 39gs, 41CV, 48G, 97
Find all posts by this user
Quote this message in a reply
04-13-2022, 01:49 AM
Post: #17
RE: Suggestions on HP21 restoration
Oh my, Ren, I didn't mean to offend anyone! Smile

In fact, I'll need to take baby steps here, one feature at a time, probably implementing the standard features, or even less than the standard, and improve from there.

About power consumption: is an 8 bit AVR really not enough to replicate the Woodstock number precision? Perhaps not using the standard float types, doing things by hand, or something similar. The reason for this is the ridiculous power consumption of AVRs, specially when run at very low clock speeds: it's in the order of uA. I don't feel very comfortable to use an ARM to emulate a 70's ACT.
Find all posts by this user
Quote this message in a reply
04-13-2022, 12:39 PM
Post: #18
RE: Suggestions on HP21 restoration
I think the only things which might prevent you calculating at higher precision is if you lacked the code space, or if the performance hit was too great.

But I suspect you'd be OK on both counts. You just need to find or write a suitable implementation.

(Maybe not just code space: you need some RAM too. But I wouldn't expect the data size would be an obstacle.)
Find all posts by this user
Quote this message in a reply
04-14-2022, 03:50 AM
Post: #19
RE: Suggestions on HP21 restoration
I agree, EdS2. It looks like an AVR is enough, but I'll try to confirm.

I'm familiar with the smaller AVR ATMega chips, they run at clock speeds from the kHz range up to 20MHz. There are options with 32kb of flash memory and more, and from 512bytes of RAM and more. I'll try to research what kind of precision I can get with this hardware.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)