Calculator Planning

Okay, I should probably start gathering requirements and architecting the calculator project. Today is 2021-02-08, and I want to have a stable-ish "product" by 2021-02-14, which gives me six working days or so.

Let's start by gathering requirements.

Raw Requirement Brainstorming

These are not sorted, or qualified. I'll try to rate them as I go. Let's call these "system requirements". Some of these are bound to already-made decisions, like the display or keyboard. Some of these are soft-made decisions, like what parts I have on-hand already (or could get within my delivery window).

  1. The system shall have a 4x6 24-key keyboard
    • PRIO: HIGH
  2. The system shall reliably read keyboard inputs
    • PRIO: HIGH
  3. The system shall have software-remappable keyboard bindings
    • PRIO: HIGH
  4. The system shall support RGB LEDs per-key
    • PRIO: HIGH
  5. The system shall support a 19-pixel RGB LED notification bar
    • PRIO: MEDIUM
  6. The system shall support an RGB 480x320px display
    • PRIO: HIGH
  7. The system's display shall be readable from "arms length"
    • PRIO: HIGH
  8. The system shall support USB-C for power
    • PRIO: HIGH
  9. The system shall be programmable over USB-C connection
    • PRIO: HIGH
  10. The system shall be programmable using JTAG/SWD
    • PRIO: HIGH
  11. The system shall support WiFi connectivity
    • PRIO: MEDIUM
  12. The system shall support Bluetooth connectivity
    • PRIO: LOW
  13. The system shall support pre-loaded apps
    • PRIO: HIGH
  14. The system shall support SD-Card loaded apps
    • PRIO: LOW
  15. The system shall support text-grid-based apps
    • PRIO: HIGH
  16. The system shall support graphical-based apps
    • PRIO: LOW
  17. The system shall expose raw keyboard control to applications
    • PRIO: LOW
  18. The system shall expose a pre-mapped and managed "key stream" to applications
    • PRIO: HIGH
  19. The system shall expose a way to select a pre-mapped and managed key mapping by applications
    • PRIO: HIGH
  20. The system shall expose RGB LED control to applications
    • PRIO: HIGH
  21. The system shall support managed RGB functionality on a per-LED basis, such as fades, cycles, etc.
    • PRIO: MEDIUM
  22. The system shall support a Piezo-based buzzer
    • PRIO: LOW
  23. The system shall have a REPL-based calculator application
    • PRIO: HIGH
  24. The system shall have a time tracking application
    • PRIO: HIGH
  25. The system shall have a todo/checklist based application
    • PRIO: MEDIUM
  26. The system shall expose the ability to load/save files on the SD card to the application
    • PRIO: MEDIUM
  27. The system shall expose the ability to make GET/POST requests to arbitrary URLs to the application
    • PRIO: LOW
  28. The system shall support TLS for GET/POST requests
    • PRIO: LOW
  29. The system shall support T9-style text entry
    • PRIO: MEDIUM
  30. The system shall support rechargeable battery power
    • PRIO: LOW
  31. The system shall recharge the battery via the USB-C port
    • PRIO: LOW

Architecture Raw Thoughts

Okay, this is feeling a little formal to even me. Let's think a bit about how to arrange all of this.

I'll probably need some kind of "OS", either a bit of a scheduler on top of RTIC, or Neotron, or something.

Dynamically loading apps will probably be a bit of a pain, since I'll need a nice C-FFI boundary layer. I'd probably get that for free from Neotron OS.

SD Card and network operation will probably be sort of awful too. Especially if I want "multitasking" with background operations.

For now, I'll probably use something relatively light-weight, hardware wise, either an nRF52 (64MHz, 1MiB flash, 256KiB RAM), or a black pill (96MHz, 512KiB flash, 128KiB RAM). In the future, I might upgrade to an STM32H743VIT6 (480MHz, 2MiB flash, 1MiB RAM, external SD/QSPI/SPI flash), but probably wont for this week because I don't think I could physically mount the board well.

My gut wants to write it all from scratch, but JP has definitely covered a lot of ground with the neotron work. Maybe I should do a one-day "spike" to try and get neotron working on the STM32H7 and just shortcut some of the other hard work? I could probably make a shenanigans breakout board that would last a couple weeks.

I could probably start with the BIOS porting:

https://github.com/Neotron-Compute/Neotron-XXX-BIOS

And the neotron user's manual:

https://neotron-compute.github.io/Neotron-Book/