Close

Phase One - Uno R3, TM1638, 4x4 Keypad Matrix

A project log for The Talking Microtronic Computer System Emulator

A Talking Arduino-Based Emulator of the Busch 2090 Microtronic Computer System.

michael-wesselMichael Wessel 05/27/2016 at 05:080 Comments

This project is basically done, but here are some log entries in retrospect, highlighting some construction issues and how solved them.

I started this project with an Arduino Uno R3, a 4x4 matrix encoded keypad, and a TM1638 module equipped with 8 7segment digits, 8 push buttons, and 8 LEDs. This was enough for a first version. The 8 push buttons of the TM1638 module were used for the function keys of the Microtronic, 4 LEDs for the digital outputs 1 to 4, a carry, zero, and 1 Hz LED flag. The nice thing about this setup was that it is basically a software project - only the keypad needs to be wired up. For a software person such as me this was a perfect starting point!

Examples PGM / ROM programs were stored in the EEPROM of the R3. It had difficulties storing longer PGM ROM example programs in the Uno, though. For example, the Lunar Lander program needs over 140 instructions. In my first attempt, I tried to store PGM ROM programs as

const char *string_table[] = { "F10 510 C00", ... }
and programs were stored as HEX strings as shown. Unfortunately, the monitor program already consumed a lot of SRAM for static and dynamic variables, and I got compiler warnings regarding potential stability issues.And indeed, the Microtronic emulator was not running stable and showed erratic behavior. The next idea was to store those program strings inPROGMEM memory. In principle a good idea, but in order to retrieve these strings back, a string buffer (in SRAM) large enough to hold the longest program string is required, and I was out of SRAM again. Hmm. Then I tried storing the PGM ROM programs in EEPROM, byte by byte (not as hex strings), but for some reason, I still encountered erratic behavior with large programs such as Lunar Lander. I hence decided to move to the Arduino Mega 2560. Where the Uno has 32k Bytes of Flash, 2k Bytes of SRAM, and 1k Byte of EEPROM, the Mega 2560 comes with 256k Bytes of Flash, 8k Bytes of SRAM, and 4k Bytes of EEPROM. That should be more than enough!

The tight memory on the Uno also prevented adding much needed features, such as the SDCard shield for storing and loading programs from SDCard, given that these shields and required libraries needed some memory, too.

Even though I couldn't store larger ROM example programs with this setup, the emulator was functional enough to enter longer programs such as the Lunar Lander by hand, and then play them, but there was no way to save the program. I continued to develop the Uno Version until my Mega 2560 arrived. I also added some buttons to the breadboard, such as a soft-reset (as the Uno's hard reset clears the program memory of the emulator), the CPU throttle pot, and the Microtronic's 4 digital outputs.

The state of the emulator after Phase One is represented by this video:

Discussions