SkillAgentSearch skills...

Iv

Powerful Programable RPN Calculator based on FORTH

Install / Use

/learn @zooxo/Iv
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

IVEE - a Powerful Programable RPN Calculator based on FORTH

Version 1.0, (c) 2020 by deetee/zooxo
This software is covered by the 3-clause BSD license.


all

See a short video of IVEE at: https://youtu.be/m1aFRhqvuLM


PREAMBLE


Ivee is a powerful programable RPN calculator based on the programming language FORTH. This innovative and powerful machine benefits of a brilliant symbiosis, as both - the RPN calculator and FORTH - are stack based systems. The name Ivee or IV stands for the roman number 4, which was also a basis for naming Forth (4th generation of programming languages).

Ivee complements a viable set of Forth words (26 commands) with a set of system oriented commands and additional built-in Forth words. In addition the user can define/program new words based on existing words and commands.

The hardware is simple: - Arduino Pro Micro - OLED display (128x64 pixel) with SSD1306- or SSD1309-controller - 16 keys (push buttons) optional: - LIPO battery - LIPO battery charger (TP4056) - ON/OFF-switch

Allthough Ivee is operated by 16 keys only it offers a wide range of functions and possibilities:

  • 120 intrinsic functions based on FORTH
  • Programming: Handle up to 40 user definable programs (Edit, New, Rename, Move, Delete, Send, Load)
  • Dictionary of all commands, words and programs
  • Fast user definable menu (longpressed F-key)
  • Calculations with complex numbers for nearly every function
  • Calculus (f(x), plot, solve, integrate)
  • Basic math operations in number systems with selectable BASE
  • Business calculator mode (accuracy of 18 digits)
  • Save up to 10 numbers/constants permanently
  • Statistics and line best fit
  • Many unit conversions
  • Clock and Torch function
  • Basic system functions (Battery voltage, Brightness, Screensaver)

Have fun! deetee


KEYBOARD, SHORTCUTS


F(G)[OFF]{MENU}  7(S+)[SCLR]    8(PRG)[BASE]    9(/)[MOD]
E(SWAP)[ROT]     4(DICT)[USR]   5(FX)[FPLOT]    6(*)[LIT]
N(OVER)[PICK]    1(RCL)[STO]    2(SOLVE)[FINT]  3(-)[LIT-]
X(CLR)[TOFF]     0(CPLX)[BATT]  .(R<>P)[CLK]    #(+)[LIT+]

PRG Shortcuts:                  BASE/HEX Shortcuts:
          5 OUT  6 UP             4 E  5 F
  1 NEW   2 IN   3 DOWN           1 B  2 C    3 D
  0 REN  . DEL  D EDIT            0 A  . A~F

MENU/DICT/REN Navigation:       SUM/STAT/L.R. Storage Registers:
         Q1  Q2  Q3  Q4           7 SN  8 SX   9 SY
  UP     E   4   5   6                  5 SXX  6 SXY
  DOWN   N   1   2   3
         PREV0   .NEXT

DISPLAY, INDICATORS


>        ... Empty stack, ready to calculate
>        ... Indicates selected program in program selection mode
<        ... Indicates selected program step in program editing mode
a~z      ... Stack level
_        ... Indicates number input
i, angle ... Imaginary part, imaginary angle
B        ... BASE mode indicator
n BASE   ... Numeric base of BASE mode
!        ... Indicates float of data stack (data loss in lowest stack level)
^, v     ... F-key, G-key

LIMITS


As a microprocessor is primarily not made to do such complex things like performing a powerful calculator there are some limits in performance and resources. Most obviously is the limited precision of the intrinsic float format (IEEE 754, 32 bit). As four bytes only are used to represent a float respective double number the decimal digits of precision is limited to 6...7. For example calculating sqrt(-1) yields in a display of "7.5E-8 + i" (instead of "0 + i"). In addition the resources of a microcontroller are limited like the FLASH memory (holds the executable program code), the RAM memory (holds variables and data while running) and the EEPROM (holds permanent data like settings or user programs). However Ivee tries to offer a maximum of features, comfort and performance with a minimum of required resources.

LIMITS:

    26   ... Maximal data stack size (a...z)
    7    ... Maximum number of displayed significant digits of a number
    36   ... Maximum number of decimal exponent digits (1E-37 < X < 1E37)
    12   ... Maximal size of text display (see EMIT, CTX)
    10   ... Maximal amount of (complex) numbers saved permanently (0...9)
    3    ... Maximal number of characters for naming an user program
    40   ... Maximal number of user programs
    128  ... Maximal size of an user program (steps)
    900  ... Maximal size (steps) of all user programs
    64   ... Maximal size of address stack ("deep of nesting")
    1E-4 ... X-range of solver (Newton) to determine slope of function
    10   ... Calculation "stripes" for integrating (Simpson)
    32   ... Maximal definable command slots of user menu

BROWSING MENUS


To navigate through the menu of some functions (MENU, DICT, USR, renamePRG)
all selectable items are divided into four sections. Every section has its
own up and down key (section I: E/N, section II: 4/1, section III: 5/2 and
section IV: 6/3).
To move to the previous or next entry (regardless which section is selected)
the keys "0" or "." can be used. To select one of the four presented items
use the appropriate function key (F/7/8/9) or escape the menu with "X".

PROGRAMMING


Ivee is able to deal with up to 40 user programs with a total number of
900 steps/commands. To deal with programs enter the program selector mode
with PRG.
While in the program selection mode on the left side of the display the
available programs are numbered and listed. On the right side of the display
the number of programs, the memory used and the memory available are shown.
To navigate between programs use the cursor keys E (up) and N (down).
Edit a selected program with # or press 1 to enter a new program.
To delete a program press "." - to rename it use the key 0.
You can move a program with 6 up or with 3 down. Note that the top program
has special calculus features (f(x), plot, solve, integrate).
To send a program (does not include the program name) via USB to another
computer press "5". Note that corresponding ascii characters will be sent
(see chapter DICTIONARY, second column). In a similar way programs can be
send from another computer to Ivee (press key 2) and will be stored as new
program.
With the 3 powerful commands @, ! and EXE (see chapter DICTIONARY) it is
even possible to manipulate the program memory and execute code.
A program is structured into the three parts NAME, COMMANDS and EOP-marker.
Please note that the length of the program name is restricted to 3
characters and the maximum number of program steps is restricted to 128.

BASE, BUSINESS MODE


To calculate with integer values with other numeric base enter the base and
select the BASE command (ie 16 BASE to calculate with hexadecimal numbers).
To return to the scientific mode press BASE again. When changing the mode
the whole stack will be converted (as far as appropriate) to the new base.
Numbers will be displayed in groups of four digits in two lines with a
B-indicator (BASE) on the left side and the base itself on the right side of
the first line. Pressing "E" enters four zeros.
Note that only basic operations (/*-+) and some stack operations are
supported. To enter digits bigger than 9 (ie F) press "." followed by a key
(ie 5 to enter F).
The BASE state will be stored permanently.
Entering the BASE mode with 10 activates the business mode to deal with big
numbers and high accuracy, like trillions of dollars with cent accuracy.
Numbers are grouped into triples and two digits after the decimal dot
(cents) are supported.

CALCULUS


Ivee is able to analyze the first user defined program. Note that you can
move the desired user program to the first position using the keys 6 or 3
in program mode (PRG).
To calculate the value of a function use F(X).
To find the root of a function enter a start value (X) and press FSOLVE.
Enter the x-range (from Y to X) before plotting a function (FPLOT) or
calculating an integral (FINT).

COMMANDS


  MEMORY
       functions         mem[]       EEPROM
    |<--intrinsic-->|<--builtin-->|<--user-->|
     0               76            120        160
              MAXCMDI^      MAXCMDB^   MAXCMDU^


  OVERVIEW
    Intrinsic
      Forth  DUP DROP NEGATE / * - + MOD DICT SWAP ROT PICK
             < = <> > KEY EMIT BASE BEGIN UNTIL IF ELSE THEN @ !
      System 0~9 . E STO RCL CLR USR NAND INTEGER PI INV SIN EXP LN
             COMPLEX REC<>POL F(X) FPLOT FSOLVE FINTEGRATE
             PRG T+ PSE EXE BREAK CLRTEXT ISREAL
             SUM+ SUM- SUMCLR COMB PERM STAT LR
             BATT LIT LIT+ LIT- CLOCK OFF TOFF
    Builtin
      Forth  OVER HEX AND NOT OR ABS
      Other  $ SQRT POWER POWER10 LOG LN! PV ND QE HMS>H H>HMS CLOCK
             COS TAN ASIN ACOS ATAN SINH COSH TANH ASINH ACOSH ATANH
             DEG>RAD RAD>DEG C>F F>C KM>MI MI>KM M>FT FT>M CM>IN IN>CM


  DICTIONARY (in order of "appearence")
    000   0     ... Numbers
    001 ! 1
    002 " 2
    003 # 3
    004 $ 4
    005 % 5
    006 & 6
    007 ' 7
    008 ( 8
    009 ) 9
    010 * .     ... Dot key
    011 + DUP   ... Duplicate, end numbe
View on GitHub
GitHub Stars57
CategoryDevelopment
Updated5mo ago
Forks9

Languages

C++

Security Score

82/100

Audited on Nov 7, 2025

No findings