Calculator

I am building an RPN calculator by interfacing a 4x4 keypad and LCD display to an 8051 microcontroller.

19th June, 2015

Today I built the circuit and initialised the display. A 4 row, 20 column Hitachi HD44780 LCD display was used, giving a total of four stack levels including the edit line. The microcontroller is a Silicon Laboratories C8051F020, an 8-bit microcontroller with 4KB of RAM and 64KB ROM. The code is written in C using the Silicon Laboratories IDE. Below are pictures of the circuit and a close-up of the display.

Photo of C8051F020 interfaced to 4x4 keypad and LCD module

Close-up of LCD display showing stack levels

Next step : implement keypad scanning and ENTER and DROP functions.

20th August, 2015

Today I completed writing the code for a 4-function (addition, subtraction, multiplication and division) RPN calculator with 3 stack levels and an edit line. The calculator has ENTER, DROP, ROT and UNROT functions, and handles floating-point values up to 10^37. The code can be downloaded below:

C code for Version 1.0

Next step : Include the circuit diagram and additional documentation for this calculator on this page.

18th September, 2015

Today I completed writing the code for a scientific RPN calculator with 3 stack levels and an edit line. The calculator handles floating-point values up to 10^37 and can store 2 numbers in memory that is retained after the calculator is switched off. The code, circuit diagram and other documentation can be downloaded below:

Program Description Code C File Circuit Diagram and Additional Resources
Calculator V1.1

A basic scientific calculator

Calculator V1.1 PDF file

Calculator V1.1 C file (open in Silabs IDE)

Calculator V1.1 CD

Calculator V1.1 Keypad

LCD PINOUT

Hitachi HD44780 datasheet

EOZ ECO 4x4 matrix keypad datasheet


For information on how to create your first C8051F020 program with the Silabs IDE, and assembly code and circuit diagrams for several projects, visit this page:

Getting started with the C8051F020 microcontroller

30th September, 2016

Today I completed writing the code for a four function integer RPN calculator with 4 stack levels and an edit line. The calculator can add, subtract, multiply and divide two signed 16-bit integers (i.e. numbers between about -30,000 and 30,000). I used the C8051F120 microcontroller and all of the code is written in assembly language.

Below is a link to a video on the two calculators I have created so far:

Video

10th January, 2017

Today I extended the RPN calculator to handle 10-digit integers (i.e. numbers between -9,999,999,999 and 9,999,999,999). Below is a PDF file of the code, asm file of the code and a circuit diagram.

Program Description Code Assembly file Circuit Diagram and Additional Resources
RPN Integer V1.0

A four function 10-digit integer RPN calculator with 4 stack levels, written in assembly for the C8051F120 microcontroller

RPN Integer V1.0 assembly code PDF file

RPN Integer V1.0 Assembly file (open in Silabs IDE)

RPN Integer V1.0 circuit diagram

Below is a link to a video of the 10-digit RPN integer calculator:

10-digit RPN integer calculator video

If you are interested in creating an open source calculator, please post on my forum:

Forum

S12 decimal calculator

AriCalculator functions v1.3

AriCalculator functions v1.3