Blog 4th Nov 2022 Swiss Micro DM41X There's a rule of thumb, almost a caution really, when it comes to technological change. For the life of me I can't remember who said this, but paraphrasing the idea, it warned that whenever tech advancement occurs, you'll see a gain in functionality, but you should expect to lose something that you like, along the way. Chances are high that the gain will far outweigh the loss, in which case you won't overly care. For example when smart phones and tablets came along, stand-alone car satellite navigation systems went the way of the dodo. Regardless of how much you liked the way those systems worked in your car, a phone could navigate just as well while detecting and routing around traffic and it could handle calls at the same time and all of this was included in your monthly phone payment. A similar thing happened to the calculator industry when smart phones and tablets appeared complete with any number of apps, including calculator emulators. The market for dedicated calculator machines slowed right down, with the exception of calculators approved for use in examinations (where a connected tablet or phone was obviously a bad idea). For an engineer, that restriction doesn’t apply and my phone now has 6 different calculator emulators (the WP34S, HP48GX, HP Prime, HP 15C, rcl57 and Free42) and they all work brilliantly. But, in my view they lack two things. The first is the tactile feel of a properly designed keyboard. The second, (in the case of an older but still extremely powerful calculator such as the HP 41CV), is the difficulty with expansion. The generalisation inherent in a smart phone or tablet is what makes it such a great product, but that often (not always) rules out bespoke applications. Personally, if I’m figuring out the VAT on a purchase, or dealing with home finances I’ll often use whatever is at hand, but if I’m working out the compression ratio of an engine (a more involved set of calculations), then I’ll always reach for a dedicated calculator and I’m very particular about the type of calculator notation I will work with. I won’t ever use algebraic infix notation calculators after using Reverse Polish Notation (RPN) all my life. There are plenty of good (along with some comically bad) explanations of RPN online, so I’m not going to repeat a good one here but just to summarise, RPN requires you to think about a problem by expressing it using postfix notation. Once you’ve mastered that requirement, the process involved eliminates any need for parenthesis and provides visual confirmations of all intermediate results. These two features combine to dramatically improve the likelihood of your result being correct. Very few people I know, who properly grasp RPN, would ever switch back to algebraic infix calculators.
Hewlett Packard HP35c Calculator 1972
Hewlett Packard are the company most synonymous with RPN machines, because in the late 1960’s they spotted a niche in the market for high end calculation machines built using an RPN foundation and set to work commercially exploiting that niche, eventually culminating in 1972 with the HP 35 pocket calculator (so named, because it had 35 keys and could fit in a shirt pocket). It would be an understatement to say what an enormous leap forward that machine was, given the vast bulk of scientists and engineers of the day were still using slide rules. Overnight, colleges dropped slide rule courses and slide rule sales plummeted. HP sold 300,000 of these astonishing HP 35 machines over the first 3 years of production (picture by Mister rf - Own work, CC BY-SA 4.0). Going back to my first point, there will have been engineers out there who would have loved their slide rules and would have regretted this advance – and that is precisely the double edge sword any significant advance brings. The counter view is nearly always reflected in a blossoming market (in this case for pocket calculators).
HP have continued to develop calculator technology right to the present day, with modern complex graphing machines taking full advantage of advances in display and touch screen technology. The newer breed of machines are however variants of the original calculators because they suit a different set of problems. They use a pseudo language for programming (RPL) and implement a sort of partial RPN but they definitely have their place (something I know first-hand because the excellent HP 48GX took me through an honours degree in Maths and Computer science. It is a superb machine - thank you HP). But for a pure thoroughbred RPN programmable calculator you have to go slightly further back in time to the late 80’s and 90’s, where we find two rather significant high points for HP. The first was the HP 41 family of calculators, released in 1979 and the second was the HP42s calculator, released in 1988. Each were unique: designed to solve different problems for different markets. The HP 41 family continued in production until 1990 - mainly because it was an extremely capable machine and one of the first to elegantly handle alpha characters. With this machine, if you wanted to create an engine displacement calculation program, you could display text prompts for the various inputs (eg: Bore, Stroke and Cylinders) and add text to explain the result. These powerful machines were the first hand held computers in their own right and in fact so precise and reliable they were adopted by NASA as flight navigation tools for nine flights of the Shuttle in the early 80’s where they were used to confidence check the on board computing system including changes to centre of gravity as fuel was consumed during the flight and for mission critical tasks such as ignition times for re-entry to Earth atmosphere. In the photo below (Curtesy of NASA), you can see three HP 41s floating to the right of the astronaut Sally.K.Ride on a mission flown on the 21st June 1983. HP 41's used in the NASA Shuttle A key reason behind the success of the 41 family was its four expansion ports, permitting easy use of memory modules, program ROMS and other hardware (picture by Sven.petersen - Own work, CC BY-SA 3.0). HP 41 expansion ports The early 41C machines could be expanded with memory modules in all four ports. But user groups figured out ways to do this with just 2 ports and later HP squeezed all four memory blocks onto one module (often known as a quad). The HP 41CV, which I bought for £263.60 in the early 1980’s – in todays’ money around £580, had that quad built in. But the expansion ports provided general address, data and control busses so could just as easily be filled with ROM modules holding collections of programs. The sheer amount of support for different suites of technically demanding software (which is still being developed today) is quite breath taking. There are modules for statistics, mechanics, surveying, navigation, high end math functions (including root solvers, complex math, matrix math and integration) to name just a few. Peripheral devices of the day could also be used in these expansion ports including card readers, bar code scanners, floppy disk storage, GPIB and RS232 interfaces serial communications interfaces and a host of others. It’s useful to remember that this wasn’t the first calculator providing support for plug in ROMs. TI calculators of the day, such as the wonderful TI 58 released in 1977 included a plug in ROM feature, but it wasn’t nearly as versatile as the 41 family implementation. I have very fond memories of my TI 58 and a TI 59 I used at the time, mainly because I used them to master the basic concepts of programming. But the limits imposed by algebraic infix notation were an object lesson to me. At the time, I was using a HP 32e calculator, which was not programmable, but in all other regards including aesthetics and build quality, ran rings around a TI 58. Product demand for the 41 family and the quality of the computer coupled with a vast, loyal and highly innovative user base resulted in production continuing right up to the 1990’s. I wouldn’t be in the slightest surprised to find them still working in labs to this day. So, how on earth could you top a machine that good? Well, a company called Swiss Micro’s rose to the challenge. Their objective being to engineer an updated 41, still running precisely the same software, but on a modern, low power, fast processor platform employing an ARM Cortex-M4F clocked at 80Mhz (see power notes below). The display utilised is a 400x240 pixel mono capable of holding a display image when switched off. The DM41X doesn't graph but the larger display is used to show some or all values on the stack, the value in the alpha register and info regarding the system including available program memory, the name of the current program and a reference to a calculator state file in flash memory. Swiss Micros added 4MB of external flash for the CPU to use and some nice features including an IR LED (with a means to drive an original HP printer) and a USB interface designed to pop up as a FAT drive when connected to a host machine. The DM41X uses an internal, non rechargeable button cell battery (life is likely to be measured in years) or it can be powered directly from the USB. When running on battery, the CPU clock is reduced to 24Mhz but is clocked at full speed when powered by the USB. Compared to an original HP 41CV machine the DM41X is blisteringly fast (actually under either power option). The DM41X was released in September 2020 and I took delivery of mine in October 2022. DM41X From Swiss Micros The DM41X doesn’t have four physical expansion ports, but it does have a USB interface that activates like a FAT drive for a PC (linux, mac or PC and so think in terms of file exchanges both ways) along with sufficient on-board memory to permit a large number of the original HP 41 family plug in modules to be stored and then selectively enabled by the user, using a pick and mix interface. A large number of modules are supplied with the machine as standard. Third party mod files (including Angel Martins' phenominal back catalogue of work with this machine) can also be loaded onto the DM41X with relative ease. The physical design is gorgeously tactile, in the sense of an excellent clicky keyboard, highly reminiscent of the quality of previous HP offerings. It has a stainless steel case with an appealing weight and strength and Swiss Micros designed the machine to be accessible, so removing the case and even the main circuit board inside is easy (no plastic hot melt stand offs to fight with and break). Again, like the original HP 41 family, overlays can be placed over the top of the keyboard to customise the machine (allowing the user to take full advantage of the USER mode which I'll mention later). An important point to grasp, is that the DM41X isn’t an emulator. It actually runs the original HP41 family code with some additions purely designed to cope with the differences in the underlying platform. Essentially, it is a code compatible, blindingly fast HP 41 and a beautiful machine to use. It is a remarkable testament to the hard work of the Swiss Micro’s team and if, like me, you like RPN and desire a proper keyboard, then I’d recommend you take a look at three (and in due time, four) excellent machines. The two Swiss Micro machines: DM41X and the DM42 but also a third party machine known as the WP-34S. The team who developed that machine have been working with Swiss Micros to build a fourth machine which would be a significant advance on the WP 34s, notionally known at the moment as the DM 43. I have to say, I am eagerly awaiting sight of that machine. Using a DM41X and one of its modules An elegant feature on many HP programmable calculators is the SOLVE function, where you take a polynomial (an equation equal to zero) and use an iterative algorithm to find its root. There are other functions such as Poly that will find multiple roots but SOLVE has a back story that always makes me smile. Hewlett Packard HP34c SOLVE was first suggested by an HP engineer called William Kahan when he asked an HP project manager at a garden party if he could have a SOLVE key. William had worked out a way to find a root of the equation f(x) = 0 using an convergent iterative algorithm and which included a suitable way to stop. What he realised was that with a programmable calculator he could split the problem into two parts. The calculator would provide the iterative logic necessary to converge on the root (and deal with the stop condition). The user would create a program to compute the function. The SOLVE user interface would simply link these two, providing a lovely harmony between machine and user. The project manager wasn’t convinced, arguing that marketing had never identified the need for this feature but as the garden party went on (and a modest amount of booze flowed) the project manager eventually said to William, “look, give me an integrate key and I’ll give you your SOLVE key”. SOLVE and integration had some caveats, which I recall from Williams interview caused the user manual writers some sweaty hand wringing, mainly because some roots can be difficult to find and so either algorithm can fail, something the manual would have to make clear. The pressure to avoid delaying release of the calculator took care of that road block and the rest is history. SOLVE (and integrate) turned out to be tremendously useful functions. SOLVE isn’t a function supplied on a HP 41CV. But it was available in a Math module you could plug into the back of a HP 41CV... a rather nice illustration of why this hand held computer was (and still is) so versatile. If you're wondering where to look for information on SOLVE (and the math module), look at this excellent web site hp41.org. Click the side navigation link “library” and then under “Software” click the “HP Application Pacs” link. Scroll down and you’ll come across the raw Math pac code and also the math pac manual (in English and Spanish) which you can download as a PDF. Open that manual and scroll to page 17 and you’ll find an explanation of the SOLVE function. Page 21 explains the POLY function which can be used to solve polynomials up to the 5th degree. The user interface for both is quite different, but you’ll be able to work through that as required. Let’s work through the steps required to use SOLVE on a brand new DM41X. The first point to understand is if you try to execute SOLVE on a brand new DM41X, you’ll get the response “NONEXISTANT”, because the function doesn’t exist on a brand new machine. Our first step therefore, is to tell the machine to include the Math module which does contain the SOLVE function.
Click Shift-Setup to open the setup menu and select module (option 2). Then select the “Active Modules” (option 1). Click the “Plug” button (which is the top left keyboard button underneath the word “Plug” on the display). Click import to browse the available options using the up/down arrow keys to reach “MATH.MOD” and then press ENTER. This selects the module as a potential candidate into the parent menu but it still hasn’t been added to the calculator module space. Make sure it is selected on the “Select modules to add” screen and then click Add to formally add it.
DM41X Selecting Module to Import
Careful here: the machine will now challenge you with an are you sure? Look at the top line and note that it states: “Active Modules (ENTER to confirm)”. You do need to hit ENTER at this point to formally confirm this challenge and finalise the modules addition, at which point the calculator will now have the Math pac module installed. For the DM41X this is the equivalent of taking a switched off HP 41CV, removing one of the four rear blanking plates and physically plugging in a math module.
DM41X confirming the module import
So now lets now look at a problem. Suppose we have an equation Ln(x) + 10x − 14.844 = 0. What value of x solves this equation? On the calculator, we first need to create a program (which I'll call FUNC) to calculate this equation (we’ll show shift key operations as yellow boxes and the alpha toggle as blue boxes). I’ve added comments on the right.
Program steps for FUNC DM41X
As a check we can quickly confirm our function is working by entering some random value for x and manually calculating the result. For example, an x of 2 should result in 5.8491.
The problem we’re trying to SOLVE is finding some value of x that satisfies the equation (FUNC(x)=0). To solve that, we invoke the SOLVE function (which resides in our newly installed Math pac) and tell it to use our new program “FUNC”. SOLVE will plug a range of values into the FUNC program iteratively until it can hone in on a solution that satisfies the equation.
DM41X using SOLVE and a programmed function
SOLVE finds the root is 1.4474 and if you use FIX 9 to improve precision you’ll see it as 1.447421622. Just as a check, keep in mind that this root is sitting in the calculator X register so you can simply execute FUNC one more time to plug this root into the equation and see what result you get. Unsurprisingly it'll be zero, to 9 DP's precision. Armed with a graphing calculator, you can also solve this problem by graphing the equation Ln(x)+10x-14.844=Y. You’d plot the result over a spread of X values and then find the crossing point on the X axis where Y=0. Being able to graphically model a function like this is a very useful tool especially when powers are involved and multiple roots are possible. The User keyboard and a new custom key The original HP 41 had a User key at the top (the DM41X has exactly the same feature - but the button is on the right side). This button toggles the calculator into two different keyboard modes: standard and user. You always know which mode you're in by checking for a small “User” icon on the display. By default all keys in user mode do the same job as the standard keyboard but you have the option in user mode to assign any function or label to a key using the ASN function. So, in User mode, keys can be customised for a particular application. If you look closely at the three HP’s in the NASA picture, you’ll spot the three calculator keyboards look different. These machines were actually running a specially defined user mode key set with a plastic overlay fitted on the top of the keyboard as an aide-memoire. Regarding knowing what each key actually does, the 41 (and the DM41X) provide an option to press and hold a key, at which point the display will announce the function that the key handles. Hold the key down for long enough and the display will switch to NULL, providing a way to cancel the function. On the DM41X there is a new, but linked feature known as the Custom Menu. You’ll spot a key on the bottom row of the machine called CST. This allows you to assign functions to any key A through to P (inclusive) along with a couple of others. Execution of the assigned function simply requires pressing CST before the key. Imagine we want to assign the function SOLVE to the top left key Σ+.
  • Press SHIFT-CST to open the custom menu edit screen
  • Press the key to assign the custom value to: in this case the top left Σ+. Note that this highlights the “A” option on the screen because Σ+ is the “A” key in alpha mode.
  • Type SOLVE (Note that you are already in Alpha mode)
  • Press R/S to confirm the change (or, click the ON key to abort)
  • Press CST to close the custom menu editor
Now, if you now press CST followed by the Σ+ key you will execute the SOLVE function. Otherwise, the Σ+ key works as per normal.
DM41X Custom Menu
Anytime you press the CST key, you will see a display showing all the new assignments made to A through P (along with shift-↑, shift-↓ and shift-alpha).
The custom feature on the DM41X provides an easy two-key method to invoke any function you like. Summary I’ve barely scratched the surface of this remarkable machine. The sheer amount of functionality in the DM41X is astonishing. It is packed full of rich and well tested functions, it is fast, light on power consumption and comes with an expensive and solid tactile feel. The icing on the cake is the reliable and well proven foundation of HP 41 family software. Swiss Micros DM41X What an absolute delight the DM41X is! Comment | Back to Quick Links...