HP Forums
8051 RPN calculator - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: 8051 RPN calculator (/thread-7513.html)



8051 RPN calculator - Dan - 01-04-2017 09:04 AM

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.


RE: 8051 RPN calculator - compsystems - 01-04-2017 05:40 PM

Very interesting project,
home page link
http://www.southerncrossmicro.com/pages/MTEST.html

[Image: IMGP1638.JPG]


RE: 8051 RPN calculator - compsystems - 01-06-2017 06:34 PM

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]


.


RE: 8051 RPN calculator - Dan - 01-11-2017 07:38 AM

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/downloads/Videos/RPNINTv1.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/downloads/Code/RPNIntegerV1.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/downloads/ASM%20File/calc5.asm


RE: 8051 RPN calculator - compsystems - 01-15-2017 03:34 PM

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


RE: 8051 RPN calculator - Maximilian Hohmann - 01-15-2017 05:09 PM

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


RE: 8051 RPN calculator - Sylvain Cote - 01-15-2017 07:49 PM

(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


RE: 8051 RPN calculator - Dan - 03-11-2017 12:33 AM

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