Post Reply 
HP-42S "reinterpretation"
05-04-2015, 01:54 PM
Post: #1
HP-42S "reinterpretation"
the following expands on a comment i made in another thread that nobody seemed to want to run with...

i've been following the 43S thread with interest, and like others lamenting of the lack of progress. so i'm going to suggest a way forward, and present a simple hardware design that can easily be proven prior to anyone developing any calculator firmware.

we've seen a credit-card sized HP-25 emulator built using quite minimal hardware, and swiss micros are shipping their tiny HP-41 reinterpretation. the level of interest in both on the forums suggests to me that perhaps the time is ripe to look at someone doing a run of 'homebrew' HP-42S calculators.

the same keyboard solution as used on Chris Chung's "HP-25C Eumulator". a standard 1602 LCD module for the display (16x2 characters, HD44780 based). 2xAA cells for power directly to processor and LCD module. a PIC32MX170F256B (28-pin DIP package) to run it all, with 256k flash and 64k RAM on board. and running a derivative of Free-42 as the calculator firmware. if 256k of flash seems a little cramped, four additional 64k banks can be added using 24C512 EEPROMs (8-pin DIP packages). the first EEPROM can be used to hold the user programs (saved there after editing), while the remaining three can be used as needsbe for 'usercode' implementations of any functions that overflow from the processor's onboard flash.

i reckoned that minimal additional components would be required beyond PIC32, display module, and keyboard switches. the processor has it's own on-board clock generation and around 20 spare I/O pins to connect to everything. the keyboard would be charlieplexed:

   

and here is the neat bit... i've chosen pinouts such that the hardware will run MicroMite BASIC. so as it stands, one can flash MMbasic, attach a TTL serial terminal to the console pins (11 and 12), and code up some BASIC to test out the operation of the display, keyboard, and any attached EEPROMs.


positive comments?


cheers,
rob :-)


Attached File(s)
.pdf  HP-42S.pdf (Size: 34.9 KB / Downloads: 57)
Find all posts by this user
Quote this message in a reply
05-04-2015, 03:49 PM (This post was last modified: 05-04-2015 04:36 PM by pito.)
Post: #2
RE: HP-42S "reinterpretation"
(05-04-2015 01:54 PM)robert rozee Wrote:  .. a standard 1602 LCD module for the display (16x2 characters, HD44780 based). 2xAA cells for power directly to processor and LCD module. a PIC32MX170F256B (28-pin DIP package) to run it all, with 256k flash and 64k RAM on board. and running a derivative of Free-42 as the calculator firmware.

HD44780 based LCDs require 5V Vcc.. Also the display is not graphical one, but 2x16 chars.. An SPI color 1.8-2.4inch tft LCD will do better, power consumption <<1mA with backlit off. Backlit needs a few mA (the same with HD44780). (Btw HD44780 LCDs do not require negative LCD bias..)

That PIC32 with 64kB ram - double check whether the free42 would even compile straight with 64kB of ram especially with decfloat (I compiled a double precision basic written for pc to pic32MZ (w/ 512kB of ram) and the max source I could load was something like 500lines.. - it depends how it is written..)

Also consider the PIC32MX170 takes ~0.5mA/MHz (there are chips with 150-200uA/MHz but ARMs).

I would add a HC-05 BT module to the serial i/o for upload/download and an sdcard socket (good for your mmbasic too).

All the components - LCD, LCD backlit, BT, sdcard, 24LCs would need a high-side pmos switch (thus you could switch them off to save power).

What I miss is an RTC.

Otherwise I think the 42s is the best HP "calculator" ever made. Quite surprised how it was made (sw-wise) considering mid 80ties design. Especially the keyboard design and menu is great, even I would replace the orange button with <- clear one. Quite happy to have it running on my galaxy S2 Smile.
Find all posts by this user
Quote this message in a reply
05-04-2015, 04:57 PM (This post was last modified: 05-04-2015 04:59 PM by robert rozee.)
Post: #3
RE: HP-42S "reinterpretation"
(05-04-2015 03:49 PM)pito Wrote:  HD44780 based LCDs require 5V Vcc.. Also the display is not graphical one, but 2x16 chars.. An SPI color 1.8-2.4inch tft LCD will do better, power consumption <<1mA with backlit off. Backlit needs a few mA (the same with HD44780). (Btw HD44780 LCDs do not require negative LCD bias..)
[...]
All the components - LCD, LCD backlit, BT, sdcard, 24LCs would need a high-side pmos switch (thus you could switch them off to save power).

the HD44780 work-alike chips used on most modern LCD modules will run quite happily on 3v, but for the LCD screen to be visible there still needs to be around 5v between Vcc and the contrast pin - hence the provision of a negative supply. a fellow engineer came up with that part of the solution, adapted from one of his other projects. using a PWM output on the processor to drive the charge pump allows for electronic contrast adjustment.

other display choices (colour, back lighting, etc) will suck battery power. and the HP-42S/Free-42 firmware has no support for colour or graphics, splicing either in would provide a major roadblock on any project timeline.

the PIC32MX170 is capable of sleeping on 20uA, so no need for any battery switching. compared to the 3000mA.h capacity of AA cells, 20uA is insignificant. and between keypresses the processor can sleep. running at 40MHz the current consumption is around 25mA, giving 120 hours of continuous running a program.

choice of components is also constrained by the requirement for through-hole components throughout. SMD parts are strictly excluded.


cheers,
rob :-)
Find all posts by this user
Quote this message in a reply
05-04-2015, 05:09 PM
Post: #4
RE: HP-42S "reinterpretation"
(05-04-2015 04:57 PM)robert rozee Wrote:  running at 40MHz the current consumption is around 25mA, giving 120 hours of continuous running a program.
I cannot imagine a "calculator" program running for 120hours Smile
A "calculator" shall be "ready to calculate" for 5years from a 3V coin battery. I have a $10 calculator (49steps), purchased 1991, running on 2xLR44, where I changed the batteries last Xmas Smile
I would run the pic32mx @2-4MHz, that is enough for a "calculator", it will still be a few times faster than the original 42s, when lucky Smile
Find all posts by this user
Quote this message in a reply
05-04-2015, 05:29 PM (This post was last modified: 05-04-2015 08:37 PM by BarryMead.)
Post: #5
RE: HP-42S "reinterpretation"
I have never owned a genuine HP-42s, so I would jump at the chance to buy a replica! If you can fit it all into the available ROM/RAM, it has a lot of potential. If the replica starts to sell well, there would be community based 3D printed case designs popping up to support your effort. I like your simple easy-to-solder through-hole parts design, and join with you in your belief that an HP-42s clone has the potential to re-invigorate the creative activity within the Open Source Calculator Community!

I did have one question after looking at your preliminary circuit diagram. What are the vertical rows of the keyboard matrix connected to? The charlieplexed keyboard scanners, that I am familiar with, use diodes to eliminate multi-key ghosting, or reduce the number of CPU I/O's required.
Find all posts by this user
Quote this message in a reply
05-04-2015, 05:35 PM (This post was last modified: 05-04-2015 05:46 PM by emece67.)
Post: #6
RE: HP-42S "reinterpretation"
I've also been thinking about the hw needed to build a "modern" RPN machine.

I'm now inclined towards ARM processors, my favorite now is the ATSAM4LS8AA. That's 512 kB flash, 64 kB RAM, Cortex-M4 architecture, serial and USB ports, AD and DA converters and with 1.5 uA current consumption in retention (aka continuous memory) mode. According to Atmel, it can run at 4 mA @ 48 MHz (sure it is higher with the required peripherals enabled). Does not have a "real" RTC but, apparently, it can be implemented in software (with a higher current than 1.5 uA, I suppose). It even has a true random number generator!

As a display I have seen these, being the 260x64 my sweet spot. There are transflective units not requiring backlight & with typical current consumptions about 500 uA, but with an sleep mode of only 1 uA.

With such current consumptions, 2 AAA cells will last for years!

Problem with the processor is that it only exists in SMT packages, I'm now studying if this can do the trick. There are plenty on youtube videos with people soldering QFN (even BGA) chips at home. A hot air soldering machine seems to help a lot and there are such machines at $60 in ebay.
Find all posts by this user
Quote this message in a reply
05-04-2015, 06:59 PM (This post was last modified: 05-04-2015 08:43 PM by BarryMead.)
Post: #7
RE: HP-42S "reinterpretation"
(05-04-2015 05:35 PM)emece67 Wrote:  I'm now studying if this can do the trick.
I have used these breakout boards. They work really well at scaling tiny SMT pin spacing up to human accessible sizes. If one segment of the community lacks the ability to solder the tiny SMT parts, another segment could supply the CPU's pre-soldered to the breakout boards. This would make using SMT CPU's almost as painless as their less capable through-hole counterparts. It would be nice to have the extra ROM and lower power capabilities of the ARM CPU's. It seems reasonable to leave room for expansion and feature enhancement. Things do tend to grow in unpredictable ways, that is the beauty (and curse) of collaborative community based development. What starts out as an HP-42s replica, could be enhanced to the point where it resembles the WP-43s prototype.
Find all posts by this user
Quote this message in a reply
05-04-2015, 09:07 PM (This post was last modified: 05-05-2015 06:21 PM by jch.)
Post: #8
RE: HP-42S "reinterpretation"
Robert, In the design using the PIC32MX170F256B, do you intend to use EEPROM as 'virtual' firmware memory, copying chunks of code to RAM before running them or as calculator continuous storage ?

The ARM way will even be more easily achieved using an already soldered device, like Teensy 3.1.
It has half the memory than the ATSAM4LS8AA, but could be a good candidate for a trial run. It also has some RTC like counter.
Did you had a look to this lcd, it has the same horizontal resolution as the original.

How much flash will be needed to host the firmware ?
At first glance, emulation mode could make the best usage of a limited flash, but it will be harder to add functionalities.
On the other hand, a re-implementation like Free42 could allow more expandability, but the current code seems much larger than what a SOC can offer us.
Though this was achieved one year ago, (but before Free42 switched from BCD20 to Intel's Decimal Floating-Point Library ?)

(02-27-2014 08:28 AM)brouhaha Wrote:  And a further clarification. The DIY4, DIY4X, and DIY5 hardware that exists and has been shown at conferences etc. does not (yet) run WP-43s firmware, because the WP-43s firmware doesn't yet exist. Up to now, we've run microcode-level 41CX simulation (with some added features like 256 flags, and four-level stack display), and Thomas Okken's Free42 (modified for seven-level stack display).

I am curious about flash and RAM footprints...
Find all posts by this user
Quote this message in a reply
05-04-2015, 10:48 PM (This post was last modified: 05-04-2015 11:20 PM by BarryMead.)
Post: #9
RE: HP-42S "reinterpretation"
(05-04-2015 09:07 PM)jch Wrote:  The ARM way will even be more easily achieved using an already soldered device, like Teensy 3.1.

When I clicked on that Teensy link I got a "Not Found" message, but this one seems to work. (The URL was terminated with .htm but should have been .html in this particular case.)

Another advantage to using the Teensy (if it has sufficient ROM) would be the built-in micro USB connector which could serve dual use as both the firmware flashing port and emulator interface. Has anyone looked into using a Teensy 3.1 in low power applications? I haven't looked into this myself.
Find all posts by this user
Quote this message in a reply
05-04-2015, 10:57 PM
Post: #10
RE: HP-42S "reinterpretation"
On a related note, did anybody else see these and immediately start salivating, both for what the product is as well as what it isn't?

https://www.teenageengineering.com/products/po
Visit this user's website Find all posts by this user
Quote this message in a reply
05-05-2015, 04:59 AM
Post: #11
RE: HP-42S "reinterpretation"
(05-04-2015 10:57 PM)Dave Britten Wrote:  On a related note, did anybody else see these and immediately start salivating, both for what the product is as well as what it isn't?

https://www.teenageengineering.com/products/po

I saw this but didn't start salivating at all because it's just a childs toy as far as real "electronic music making" is concerned. Their OP1 synthesizer is a little better but for 949 EUR you can buy a real computer which runs circles around it (although it is not so portable).

Anyway, for calculator emulation it looks rather interesting (providing that it can be "repurposed") but doesn't have enough keys, IMHO.

https://www.hrastprogrammer.com/hrastwood/
https://hrastprogrammer.bandcamp.com/
Visit this user's website Find all posts by this user
Quote this message in a reply
05-05-2015, 11:07 AM
Post: #12
RE: HP-42S "reinterpretation"
(05-05-2015 04:59 AM)HrastProgrammer Wrote:  
(05-04-2015 10:57 PM)Dave Britten Wrote:  On a related note, did anybody else see these and immediately start salivating, both for what the product is as well as what it isn't?

https://www.teenageengineering.com/products/po

I saw this but didn't start salivating at all because it's just a childs toy as far as real "electronic music making" is concerned. Their OP1 synthesizer is a little better but for 949 EUR you can buy a real computer which runs circles around it (although it is not so portable).

Anyway, for calculator emulation it looks rather interesting (providing that it can be "repurposed") but doesn't have enough keys, IMHO.

Yeah, it would need more buttons, and a general-purpose dot-matrix/segmented LCD, but the mass-produced look of it makes you wonder if it's a slight customization of a existing platform from an outside vendor.

As for being toys, they're clearly not meant to compete with stage or studio synthesizers, but would an HP 42S spinoff really be expected to eclipse Mathematica or other high-end software? Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
05-05-2015, 01:09 PM (This post was last modified: 05-05-2015 01:12 PM by robert rozee.)
Post: #13
RE: HP-42S "reinterpretation"
(05-04-2015 09:07 PM)jch Wrote:  Robert, In the design using the PIC32MX170F256B, do you intend to use EEPROM as 'virtual' firmware memory, copying chunks of code to RAM before running them or as calculator continuous storage ?

The ARM way will even be more easily achieved using an already soldered device, like Teensy 3.1.

i've given little thought to how external EEPROMs would be used, beyond the need to provide some external (off-soc) storage. for the sake of robustness, it is desirable to not write to onboard flash on a regular basis. i do know that in some models of calculator casio, flash is used instead of battery-backed RAM, with the RAM copied into flash whenever the calculator is turned off, and retrieved when turned back on - this seems like a rather good scheme.

the "teensy" seems to provide no advantage over the PIC32MX170. both have identical quantities of RAM and flash, with comparable speed. but the PIC will run on two AA cells directly and has low-power modes, while the teensy needs 3v3. and the teensy cost 4x as much (us$20 versus <us$5).

the big winner with the PIC32MX170 is the ability to supply it as part of a kitset that almost anyone can assemble. and then there is MMbasic, which means the hardware can be tested before any calculator firmware is available.

my interest in this project is design of the hardware, presenting a simple concept that can be turned into something physical onto which the software can be loaded. this seems to be the stage that many complain the 43S is not at. i also wish to help prevent the project being killed dead by "feature creep" - no colour, no graphics, no bluetooth, etc. just a 'pure' 42S reinterpretation.


cheers,
rob :-)
Find all posts by this user
Quote this message in a reply
05-06-2015, 08:41 PM
Post: #14
RE: HP-42S "reinterpretation"
(05-05-2015 01:09 PM)robert rozee Wrote:  the "teensy" seems to provide no advantage over the PIC32MX170. both have identical quantities of RAM and flash, with comparable speed. but the PIC will run on two AA cells directly and has low-power modes, while the teensy needs 3v3. and the teensy cost 4x as much (us$20 versus <us$5).

the big winner with the PIC32MX170 is the ability to supply it as part of a kitset that almost anyone can assemble. and then there is MMbasic, which means the hardware can be tested before any calculator firmware is available.

Sorry for my bad english, it is not my mother tongue.

Robert, it was not my intention to challenge PIC vs ARM vs Teensy,
but rather to suggest an alternative to the difficulties raised by the SMT chip spotted by Emece67.

Argue about which processor is the best seems pointless.
Wouldn't it be more meaningful to have on one hand a calculator core,
as far a possible unrelated to the underlying hardware, with limited Keyboard / Display / I/O interfaces,
and on the other hand some shell dedicated to the real hardware ?

Thomas Okken's Free42 seems builds on this scheme.
Now the last versions of Free42 are too large to get into 256k or even 512k flash and 64k ram, but you get the idea ?

That could lead 43S firmware to run on differents layouts and override the actual hardware sticking point.
It is not about vaporware, only to allow everyone to work on the shell to try to get it run on his favorite layout.
At last, maybe some 'winner' may emerge from this challenge, who knows ?


Regards.
Jean-Christophe.
Find all posts by this user
Quote this message in a reply
05-13-2015, 02:15 PM
Post: #15
RE: HP-42S "reinterpretation"
When it comes to hardware, I was looking on Kickstarter at a $9 PC...
https://www.kickstarter.com/projects/159...nav_search

Especially the PocketCHIP version, with a 4.3" screen.
$49 plus postage.
Trouble is - the keyboard looks awful.

Keyboard layout, labels and "feel" (haptic feedback?) are important.
Find all posts by this user
Quote this message in a reply
Post Reply 




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