You are on page 1of 1

retronics infotainment

µWatch: return of the scientific calculator watch

David L. Jones (Australia) Packard for use in some of their formed on pre-entered val- tions are performed more like
The last few years have seen a very first calculators, and they ues. This is known as ‘postfix you see them on paper.
retro watch revival, with ‘geek’ still sell RPN capable calculators notation’. In Algebraic mode The algebraic mode supports
watches of all sorts — Nixie tube today. I thought that no compre- on the other hand, x is entered six levels of parentheses like
watches, LED watches, PONG hensive calculator watch would first, followed by the x^y com- most basic scientific calcula-
game watches and so on. This be complete without RPN func- mand, and then the routine tors. Full operator precedence
month’s Retronics page takes tionality, so it’s available as a must wait for the y value to be is maintained with each level
an unusual slant by present- user selectable option. The RPN entered. This is known as ‘infix of parentheses.
ing µWatch, which beats all of mode is based on the classic HP notation’. In the Algebraic ‘stack’ there
the above hands down for DIY 4-level stack with X/Y/Z/T reg- Somewhat confusingly, in Alge- is a basic working set of reg-
nerdiness. isters, with T register copy func- braic mode, some operations isters containing X, Y and Z
The last scientific calculator tionality, as follows: such as SIN and LOG use post- Registers. The Z register is used
watch was the Casio CFX-400 fix notation, just like RPN. So when operator precedence is
way back in 1985! It is so sought RPN Stack you enter 10 SIN, not SIN 10. called for. E.g. 1+2*3 would
after today that even broken T Register This is a common method used result in the 1 being shifted
ones can fetch many hundreds Z Register on commercial algebraic cal- into the Z register. If a paren-
of dollars. And a pristine one Y Register culators such as Casio’s. This is thesis is opened then the entire
in working condition? — if you X Register why many people like RPN, it’s contents of those working reg-
have to ask the price, you can’t consistently postfix notation, so isters and operators are shifted
afford it. So not only has a sci- In RPN mode, values get there is never any confusion. up one level into the parenthe-
entific calculator watch not been ‘entered’ onto the stack by If you compare the source code ses working registers. Likewise,
available for 20 years (leaving pressing the ENTER key. Oper- for the RPN and Algebraic when a parenthesis is closed
engineers bereft), you’ve never ators and functions will auto- modules, you’ll notice that RPN the registers and operators
been able to get the satisfaction matically perform the ENTER is much simpler and easier to are dropped back down one
of building your own, until now. function if it has not already understand. With the RPN stack level. So in effect it is one big
By way of this short article, the been done. system, you can perform pow- 7-level-deep-by-5-value-wide
µWatch project is a great occa- All operators and functions erfully complex calculations stack. Compare that with the
sion to rekindle memories of cal- work on either the X register using very simple commands. simple 4-level-by-1-wide RPN
culator watch use at University or or the X and Y registers. So to There is no operator prece- stack. Yet the RPN stack, if used
College in the 1970s and 1980s. add 1 + 2 you would key in 1 dence or parentheses to con- correctly, can be more power-
Raise your hands please! ENTER 2 +. tend with. However, RPN does ful than the Algebraic stack.
µWatch is a modern incarnation If a value gets into the T reg- require that you think about
of the calculator watch, now built ister it ‘sticks’ and stays there how you do your calculation Full details on construction and
using contemporary components until manually cleared. This is before you enter it, as it does programming of µWatch may
like SMDs and a PIC microcon- a useful function for repeating not calculate the same way you be found at the author’s web-
troller. It supports both Algebraic calculations. see it written on paper. site [1]. The project was devel-
and RPN calculation modes. The menu options are iden- Algebraic on the other hand oped entirely with the Micro-
Why RPN? Why not! RPN is not tical for either RPN or Alge- requires the use of nested chip C30 C compiler within the
only efficient to code and use, braic mode, but they do dif- parentheses and operator MPLAB environment.
but it still has a big user base of fer in the way they operate. precedence, and this can get (080816-I)
HP calculator enthusiasts. RPN As RPN works based on pre- very complicated from a pro-
stands for Reverse Polish Nota- entered values on a stack, so gramming perspective. But the Internet Link
tion. It was invented by Hewlett functions such as x^y are per- end result is that your calcula- [1] www.calcwatch.com

Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are
welcomed; please send an email to editor@elektor.com

1/2009 - elektor 77

You might also like