The GD9841R Calculator
16 digit 14 segment LED display
20 digit x4 line LCD display
ATSAMD21G18 ARM Cortex M0 processor, 48 MHz
256K of FLASH, 32K of RAM
Rotary dial to select functions
Real time clock
Arduino IDE programmable in C++
Software updated to version 11.9
The GD9841R Calculator
16 digit 14 segment LED display
20 digit x4 line LCD display
ATSAMD21G18 ARM Cortex M0 processor, 48 MHz
256K of FLASH, 32K of RAM
Rotary dial to select functions
Real time clock
Arduino IDE programmable in C++
By Gordon Dyer (gordyer@gmail.com).
To learn Arduino C++ programming, I decided to build a calculator that emulates the RPN stack of an HP-41C or HP-42S.
Using a 16 digit 14 segment alphanumeric display gives each character the look of the HP-41 but with a more retro LED display the size of old Nixie tube characters from the '50's and '60s.
To display the full 4 number RPN stack, I added a 20x4 LCD display with RGB back-lighting. The back-lighting colour is used to indicate the battery charge level, it changes from green through orange and then red as the battery discharges.
Calculations all use double precision 64-bit numbers. The 11 bit width of the exponent allows the representation of numbers between 10^−308 and 10^+308, and the 52 bit fraction gives full 15 to 17 decimal digits of precision.
The keyboard is a 6x5 matrix with traditional full travel key switches and key caps in a 70's colour scheme very reminiscent of the HP9825. https://www.hpmuseum.org/hp9825.htm
Selecting one of the many functions on the HP-41C or HP42S is a slow and painful process taking many key presses, so I have used a rotary encoder switch to select functions quickly. Apart from all the usual mathematical functions I have implemented a few unusual ones, including Prime Numbers, Number of Primes, Fibonacci sequence, Golden Ratio, Chinese Zodiac (to nearest year) and Volume of oil in a cylinder on its side. This is because my heating oil tank is a large cylinder on its side, 2.1m long and 1.2m diameter and I need to know how much oil is there from the oil depth tube.
A real time clock is included and the date and time can be shown on either of the two displays.
The power up display:
The famous HP-41C "Flying Duck" character announces the calculator is ready to use:
The LCD display is used to show the 4 number Stack X, Y, Z, T and can display the time, battery condition and indicates battery charge level using the RGB backlight colours.
Under the Bonnet (Hood) - there's not much in there!
Top left - Rotary encoder/switch
then the Sparkfun 20x4 LCD with RGB backlight
Top right - Keyboard PCB
Middle - a red shadow in the lid shows the back of the LED display board and red acrylic window
Bottom left - a stack of 3 Adafruit Feather boards with ATMEL M0 processor and SD card at the bottom, the DS3231 real time clock in the middle and the sparkfun Qwiic I2C interface on top.
Bottom right - LiPo battery 2000mAh and mounted on it is an Adafruit Battery monitor and 'fuel' guage
Inspiration for the GD9841R was taken from the HP9825, the HP-41C and the HP-42S
HP9825A Numeric Keys
A 14 segment display was chosen to look like the HP-41C
See the Museum of HP Calculators: https://www.hpmuseum.org/hp9825.htm
Functions implemented using the Rotary switch:
00 "HELP" Help for key functions
01 "1/X" Inverse of X
02 "2^X" 2 to the power of X
03 "10^X" 10 to the power of X
04 "ABS" Abolute value of X
05 "ACOS" Arc Cosine
06 "ASIN" Arc Sine
07 "ATAN" Arc Tangent
08 "AVG" Average of the 4 stack values
09 "BES0" Bessel function J0
10 "BES1" Bessel function J1
11 "CAS" Cosine And Sine, Cos+Sin
12 "CBRT" Cube Root
13 "CHIZ" Chinese Zodiac
14 "CLST" Clear the Stack registers
15 "CLT" Clear T register
16 "CLX" Clear X register
17 "CLY" Clear Y register
18 "CLZ" Clear Z register
19 "COMB" Combinations of X and Y
20 "COS" Cosine
21 "COSH" Hyperbolic Cosine
22 "e^X" Euler's number raised to the power of X
23 "FIBO" Fibonacci sequence number of X
24 "FP" Fractional Part using modf()
25 "GAMA" Gamma function
26 "GAML" Log Gamma function
27 "HCF" Highest Common Factor of X and Y
28 "HYPT" Hypotenuse of a right angle triangle
29 "INT" Integer part of X
30 "IP" Integer part of X
31 "IPFP" Y=Integer part of X, X=Fractional part of X
32 "LCM" Lowest Common Multiple of X and Y
33 "LNe" Natural Logarithm base e
34 "LOG" Log base 10
35 "MOD" Modulus (if X is -ve then X=-X)
36 "N!" Factorial of integer part of X
37 "PERM" Permutations of X and Y
38 "PHI" Golden Ratio
39 "PI" Constant Pi
40 "RCLn" Recall memory location n to X register
41 "REM" Remainder of Y/X
42 "RLDN" Roll the Stack Down
43 "RLUP" Roll the Stack Up
44 "SIN" Sine
45 "SINH" Hyperbolic Sine
46 "SQRT" Square Root
47 "STOn" Store Y in Memory location n in X register
48 "TAN" Tangent
49 "TANH" Hyperbolic Tangent
50 "TANK" Filled volume of cylindrical tank on its side Z=length, Y=diameter, X=fill level
51 "X^2" X Squared
52 "X^3" X Cubed
53 "Y^X" Y raised to Power X
54 "XRTY" Xth root of Y, Root = exp(ln(X)/Y)
The Source code is written in C++ using Arduino IDE (Integrated Development Environment)
Contact: GorDyer@gmail.com