Windows 10 rpn scientific calculator3/18/2023 ![]() It is rated for 5v but the logic works fine at 3.6v. The LCD is an HD44780 compatible 20x4 character LCD. The LCD and keyboard share the same pins since they are never used at the same time. The keypad is formed from 42 tactile buttons arranged in a 6x7 matrix and read with a 74HC165 shift register by the master MSP430. The 17th address pin is controlled by the first MSP430 and allows the program to switch between two separate stacks. The address lines of the SRAM are driven by two 74HC595 shift registers controlled by the second MSP430. The other is connected to the data lines of 128k of parallel SRAM and does all of the calculating. One of them (the master) reads the keyboard matrix, updates the LCD, and manages the interface. My design uses two MSP430G2553s connected over UART. The interface code also added a lot more to the size than I expected but I was able to add checks for most of the functions and add some meaningful error messages. Part of this is due to all of the functions used to access external memory. In the end it grew bigger than this and I had to use two MSP430s to hold everything. When I began this project I wasn't sure how much I could fit into 16kB of firmware space. The settings page also shows the current battery charge. After setting the accuracy, the program finds the largest element in the CORDIC table that is still significant, so that no time is wasted on elements that have no effect on the answer. With 32 decimal places calculations take 3-4 seconds. With the default of 12, trig functions calculate in about a second. The settings page allows the accuracy to be set from 6 to 32 decimal places. After setting accuracy to 24 places arcsin(arccos(arctan(tan(cos(sin(9)))))) evaluates to this: One way to measure the accuracy of calculations is with the calculator forensic found here. I was able to speed the shifting up even more by using another lookup table that let me right shift 4 digits at a time. Instead, a lookup table is used with adds and shifts, which are much faster. This is a very efficient way to compute these functions for processors that cannot multiply or divide quickly. The trig and log functions are computed using CORDIC routines. Unsigned char *text2=(unsigned char*)230 Unsigned char *text1=(unsigned char*)200 Here is an example:įor (int i=0 msg i++) putchar(msg) įor (int i=0 RAM_Read(msg+i) i++) putchar(RAM_Read(msg+i)) These are usually ignored by the compiler if they are not recognized, so they are a convenient way to communicate with the preprocessor. To mark variables as external, #pragma directives are used. External variables are all stored as pointers, so the PC version will work exactly the same with or without the preprocessor. ![]() To simplify things, I wrote a preprocessor program that looks for any variables that need to be stored in external RAM and converts access to them to function calls. Would become something like this (assuming we are passing pointers): I wanted to access this memory using variables but there is no convenient way to do this since every variable requires a function to access it. Numbers are stored in unpacked BCD format on an external SRAM chip. You can download it from GitHub if you want to test out the functionality: rpnmain_pc.c It will compile for Windows if #WINDOWS is defined or for Linux with the ncurses library if #LINUX is defined. While I was writing the code for BCD calculations, I used a console program to test the routines. The interface shows 4 levels of the stack, similar to some HP calculators. Functions: (a)sin, (a)cos, (a)tan, y^x, x root y, e^x, ln, 10^x, log, mod.Internal accuracy configurable from 6 to 32 decimal places.Display: The more vertical lines on the display, the easier it is to fit equations and solutions on it.This is a scientific calculator I built that uses RPN notation.Check which functions are included in a calculator before buying Applications: Are you an engineer? Surveyor? Medical professional? Math student? All scientific calculators aren’t created equal.By contrast, a student or teacher buying for a classroom may want more affordable options and solar power to save on battery expense Cost: Working pros care less about cost and more about getting the job done.When buying an HP scientific calculator, consider whether you’re a technical professional, student, or a high school teacher, then check out the following details: There are a few different reasons to buy a scientific calculator, which means different people will need different specs.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |