Hardware Mock-up Programmed

A project log for Terminal-BASIC programmable calculator

A poket-to-laptop size microcomputer/programmable calculator, based on Arduino DUE and Terminal-BASIC

ptravptrav 03/07/2020 at 07:490 Comments

I have continued debugging the hardware mock-up. The fundamental target was to program a simple RPN calculator UI with 6 operations plus a number of scientific functions. The integration with BASIC will come later, after all the hardware components are finalized.

New Pro Micro clones with 3.3V processors have arrived, so the logic level conversion is no longer necessary. See the new wiring diagram in the file section.

Files are uploaded to (its a proof-of-concept code, use with caution!)

Two problems have been hit so far. Firstly, the real-time clock of ESP32 is not very precise in the sleep mode; thus an external RT clock module is required in the future. Secondly, the sleep current of this particular Dev board is 15 mA, while in running (no WiFi) - 55 mA. Need to troubleshoot it a bit further.

Currently the mockup looks a bit neater and can run from standalone power. Can you take it to the math exam?

The current functionality fully operational and tested:

(1) Hardware keyboard (a mock-up so far), with CP1251 code page support;
(2) LCD power manager, with PWM control and sleep capability;
(3) LCD driver with fancy LCD font, resembling Electronika MK-90;
(4) Sleep mode and wake-up by a hardware button;
(5) RPN calculator UI.

The font looks like this:

Or in Russian:

The current functionality implemented, but not fully tested:

(6) Serial connectivity to Arduino Micro Pro;
(7) SD card reader.

The deferred / not yet implemented functionality:

(8) Beeper;
(9) LiPo charger / battery;
(10) Independent RT clock.

The hardware is running a simple RPN calculator interface. The operation is as following:

o The calculator can be operated by either the hardware keyboard or a serial port terminal.

o The display is composed of 2 parts: the upper depicts the RPN stack, the lower is for entering commands.

o Enter numbers as normal, e.g. 123, 123.456, 123.456e89, 123.456e-89 etc. "E7" or "e7" stand for "10 power 7". Buttons <DEL>, <Backspace>, <Home>, <End>, <Left>, and <Right> should work as expected.
o Besides the entry as above, the following is allowed: 123k, 123M, 123c, etc. The letter is an "engineering multiplier": f="e-15", p="e-12", n="e-9", u="e-6", m="e-3", c="e-2", d="e-1", k="e+3", M="e+6", G="e+9", T="e+12", and P="e+15".

o Upon entering a number, press <Enter>. If the number in the entry line is valid, it is processed into the X-register, if not - ignored. Upon entering the number in stack, all the values shift by one position. The current stack is 20 numbers.

o Alternatively, press an operation button <+>, <->, <*>, </>, <^>, or <+/->. If the number in the entry line is valid, it is processed into the X-register, if not - ignored. Upon this, an RPN operation on stack is performed. Division by 0 causes an error, which can be cleared by pressing <ESC>.

o The available math functions:   sin, cos, tan,
  sqrt - square root,
  sq - square,
  exp - e power x
  inv - computes 1/x
  hex - converts x to hexadecimal (rounds to integer first)
  o Stack manipulation functions:
  prev - previous X (shortcut: PGUP),
  swap (shortcut: DOWN),
  push, pop,
  roll (shortcut: PGDN)
  previous entry (shortcut: UP)
  #scr status - updates status label
  #scr labelx - updates label X
  #scr labely - updates label Y
  #scr labelz - updates label Z
  o Screen power and brightness:
  #scr off - puts screen to sleep
  #scr on - wakes up screen
  #scr+ - increase brightness
  #scr- - decrease brightness