HP Forums

Full Version: 8051 RPN calculator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I was asked to make a project I am working on known in this forum. I am developing an open-source RPN calculator using the 8051 8-bit microcontroller:

https://www.youtube.com/watch?v=p7MBGPf2i6E

I have just finished writing assembly code for a four function integer calculator with 4 stack levels, drop, swap and three error messages, "Overflow" (for results greater than 9,999,999,999), "Underflow" (for results less than -9,999,999,999) and "Divide by 0".

I am using a 4x4 keypad and two shift buttons and a graphical LCD. The code is about 3.8 kB. The Silabs C8051F120 microcontroller I am using has 128 kB Flash, and I hope to place the circuit diagram and code on my site soon.

All going well, I will next write code for a calculator that handles decimals, probably 10-digit mantissa and 2-digit exponent.

I am using a Silabs development board to program the chip. A major challenge for me is building a PCB and JTAG interface for the fine-pitch microcontroller to move beyond the breadboard to a handheld device.
Very interesting project,
home page link
http://www.southerncrossmicro.com/pages/MTEST.html

[Image: IMGP1638.JPG]
Another project of the same author.
MTEST: Computer Aided Assessment package for the HP50g graphics calculator
http://www.southerncrossmicro.com/pages/HP50g.html

[Image: MTEST10.gif]


.
Below is a link to a short video on the 10-digit RPN calculator. Excuse the quality - I made it with my old digital camera:

http://www.southerncrossmicro.com/downlo...NTv1.0.AVI

Here is a link to a PDF of the assembly code. The program is just under 3.8 kB (3769 bytes):

http://www.southerncrossmicro.com/downlo...erV1.0.pdf

And here is the assembly file, which can be opened in Silab's free IDE with unlimited Keil compiler:

http://www.southerncrossmicro.com/downlo.../calc5.asm
Is an interesting project, but the development kit is not so common, I think that porting it to ARDUINO or similar would have more followers
Hello!

Really interesting. I like the large display that you are using (being someone over 50 years of age reluctant to wear reading glasses ;-) ). But as comsystems already wrote, the microcontroller is quite uncommon in the tinkerer scene. I wouldn't even know how to connect that to my Macintosh and how to program it.

And one more thing: Isn't the "underflow" in your video really a "negative overflow"? I am no IT person so I am only guessing here, but I always thought an underflow occurs when a number is closer to zero than the computer can represent.

Regards
Max
(01-15-2017 05:09 PM)Maximilian Hohmann Wrote: [ -> ]I wouldn't even know how to connect that to my Macintosh and how to program it.

Hello Maximilian,

Like in this case (Keil compiler), most of the embedded world tools are for Windows only.
For ARM CPU & MCU, I use CrossWorks IDE which is available on Windows, macOS & Linux.
CrossWorks support GNU GCC and Clang/LLVM C/C++ toolchains and support several JTAG/SWD debug probes.
The price for Personal Non-Commercial License is $150 USD which is pretty reasonable for personal projects.
For other targets, I am forced to use developments tools on a Windows virtual machine on my Mac.

Best regards,

Sylvain
I have suspended the 8051 RPN calculator project to focus on developing the AriCalculator, which is a handheld programmable calculator created by Dirk Heisswolf:

http://www.hpmuseum.org/forum/thread-7773.html

Dan
Reference URL's