Hasty Briefsbeta

Bilingual

Back to BASICs with a Pro Micro Microcontroller

a day ago
  • The author built a BASIC interpreter called PMBASIC for the SparkFun Pro Micro microcontroller to enable interactive programming for physical computing.
  • The Pro Micro was chosen for its low cost, built-in USB, and specs (32KB flash, 2KB RAM) similar to 1970s home computers.
  • The goal is to lower the barrier for kids to experiment with hardware, requiring only a terminal emulator and no additional software.
  • The parser combines recursive descent for arithmetic expressions with line-by-line pattern recognition for BASIC statements.
  • The editor is minimal, using line numbers for program entry and commands like LIST, LOAD, SAVE, and NEW; LOAD/SAVE use the 1KB EEPROM.
  • Performance is about 500 empty loops per second, slow compared to C but adequate for experimental use.
  • A major challenge is the AVR Harvard architecture, which requires careful management of static data between flash and RAM, complicating parser implementation.
  • The author notes that newer devices like the Raspberry Pi Pico might offer a better platform for such interpreters.
  • The project source code is available on GitHub, but further development is uncertain due to architectural limitations.