RPN Scientific calculator on 328p

I have ported the 64-bit part of the Berkeley softfloat library to the Arduino. To that I have added a 64-bit floating point math library, which I then used to create this fully functional RPN calculator.

The libraries and code is available at GitHub - mmoller2k/ec: Easy Calc 64-bit floating point RPN calculator for arduino. The 64-bit floating point library is at GitHub - mmoller2k/Float64: Double precision 64-bit floating point library for Arduino, and the math library is at GitHub - mmoller2k/Math64: Double precision 64-bit floating point math library for Arduino

There's no schematic diagram - the 16x2 LCD connects in 4-bit mode to the controller. The columns of the 5x7 keyboard share the pins with the LCD (RS, D0-D3), but separated by five diodes (1N4148). The cathodes go to the controller/LCD and the anodes go to the keyboard columns. The keyboard rows connect directly to unique pins. For power I used three AA batteries.

The design compiles to very nearly 32k, so there's no space for a bootloader. You will need a programmer, or another Arduino acting as one, to program the chip.

Some specific features include:
6 level stack
26 variables
Hex/decimal toggle
degrees and radians trig functions

Nice, K+. :wink:

I realize this post is super old and the original author is probably not going to answer. I'm hoping someone smart can chime in to help me build this project.

Its really cool how you can share digital inputs between the LCD and the keypad by using the diodes. I found additional info on AVR freaks.

But why share the pins if there are still unused pins on the atmega328p?
Why does it say use pins 0-3 on the LCD? I thought when you used an HD44780 in 4 bit mode, you use pins 4-7.[/b]