Close

Phase Seven - The Talking Microtronic Emulator - Mega Version 3

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 13:350 Comments

I liked the Emic 2 so much that I decided to buy a second one, and this one was going to be installed permanently, making the emulator speak all the time. I found two more unused IO pins that would work with the software serial library (not all pins support the required change interrupt), and mounted the Emic 2 to the base board. I purchased a (passive) ham radio speaker; the Emic 2 has an internal amplifier which is powerful enough to drive a passive speaker. The sound was loud and clear.

The inclusion of the software serial library into the Arduino sketch plus many more strings for the utterances of the Emic 2 now caused some major headaches. Suddenly, with the Emic 2 being part of the setup and all these strings being created dynamically using the String library, the file IO operations and LCD shield were no longer working properly. One effect was that the file bowser crashed, showing random characters on the LCD. Only a hard reset would resurrect the emulator then.

After a lot of debugging and trial and error I found a major culprit - the String library, and the SDCard library using the String library internally. Since there are neither destructors nor Garbage Collection, it seems that dynamically created strings are causing memory leaks, and at some point, the Arduino simply runs out of SRAM. I had to bite the bullet and removed the String library completely from my code, using character arrays / buffers instead. In addition, I replaced the SDCard library with the SdFat library. That solved all my stability issues, but it required some major code revisions.

The built in Emic 2 now confirms every keypress and function key, and the cursor keys - when not being used for file operations - trigger the following Emic 2 operations:

Also, activities such as loading a PGM or SDCard program, clearing the program memory, and displaying or setting the time, are confirmed and spoken by the Emic 2. The clock program / PGM 4 is turned into a talking clock. While PGM 4 is running, a press on the right cursor key make it speak the current time.

So, the monitor program / operating system was speaking by now - but of course, I also wanted to program the Emic 2, making it speak arbitrary sentences. The previous setup in Phase Six used the digital outputs of the Microtronic as well as another Arduino Uno as an intelligent receiver buffer and baud converter for the Emic 2. Obviously, it would be much nicer if the Emic 2 could be accessed and programmed directly by means of certain 2090 machine instructions, with no extra hardware nor wiring required. However, there are no unused OP codes in the Microtronic which could be used for that purpose (all OP codes from 000 – FFF have a meaning!) So, I couldn’t just invent a new OP code for accessing the Emic 2. But wait - there are redundant op codes. The effect of a MOV xx = 0xx instruction is to copy the contents of register x onto itself, so these instructions are basically vacuous, and no real Microtronic program is using them for anything. I hence gave them an extra meaning / extra effect – in addition, a MOV xx also sends a (high- or low) nibble x to the Emic 2. A full ASCII character with decimal code xyz (e.g., 120 = xyz for character “x”) is thus sent via instructions 0ww, 0zz, where w is hexadecimal for xy - note that xy <= 12 (ASCII goes from 0 to 127), and hence w can take hex values from 0 to C. This decimal-based hex coding is used in order to make the entry of ASCII character codes more convenient. In order to speak a sentence, the Emic requires a heading “S” as well, and then a trailing CR (ASCII code 13). To make the Emic 2 thus speak “xyz” ("ex why zee") it takes the program “088 033 0CC 000 0CC 011 0CC 022 011 0033”. Consequently, the Microtronic program memory can now store 126 characters of Emic 2 speech.


Discussions