I have always been fascinated with speech synthesis - I guess a good dose of SciFi movies in my childhood nurtured this fascination, from "Colossus - The Forbin Project", over HAL 9000 in "2001" and "2010", to "Proteus 5". In 1984, when I got my original Microtronic, a page in the Microtronic Manuals announced that a speech module for the Microtronic was under development, and that it would be available soon (the manuals were printed in 1981). Well, that never happened. 35 years after this announcement, I decided it was time to make this promise true, and finally have a speaking Microtronic Computer System - I hence ordered the Emic 2 TTS module, and started tinkering with it. Programming it over the software serial port from an Arduino turned out to be really easy. All it required were two digital pins, on for RX and one for TX, and the software serial library at 19.200 baud.



However, it was more challenging to actually connect it to the Emulator or even the original Microtronic. The Microtronic only has 4 digital outputs, and can achieve something in range of a couple of bauds (perhaps 5 to 10?). I was investigating how to increase the baud rate using UARTS and similar devices, buffers and shift registers, but it turned out to be too complicated. Notice that the baud rate has to be accurate within 10%, otherwise the Emic 2 will not receive anything, and the Emic 2 can not go slower than 19.200 baud. It turned out that the simplest solution was to use another Arduino Uno as an intelligent "buffer" and baud converter. The Uno would listen to the 4 digital outputs of the Microtronic and act as a receiver / input buffer. When ready, it would flush the buffer at 19.200 baud over software serial to the Emic 2, making it speak.



Listening to the 4 digital outputs of the Microtronic (and of the Emulator as well) turned out to be difficult, too. First, I had to "invent" a data transmission protocol which would be timing independent and hence more robust - I needed a "self clocked" data transmission protocol, without any start or stop bits, which would also not require a fixed baud rate. I decided to use the zero as a clock signal in the data stream - in order to then transmit zeros in the data stream, I simply added +1 to all data nibbles. That way, a zero always means "wait for the next nibble". The second challenge was that even with data transmission rates as low as a couple of bauds, the digital inputs of the Arduino were somehow too slow and I couldn't get reliable readings. I was using a 4bit counter as a test, and received values such as 0, 1, 3, 2, 3, 5, 4, ... I tried reading directly from the PORTB register of the ATMega, instead of using the Arduino IO. This solved the speed problem (reading is much faster then!), but still the read values were shaky. I could only overcome this problem by using the Arduino's analog inputs, and setting analog-to-digital conversion thresholds manually.



Finally, it worked with the emulator, and a little bit later also with the original Microtronic! The Microtronic could finally speak. The sketch for this Emic 2 Uno buffer is on the Github page as well. There is one version for the emulator, and another one for the original Microtronic. But version are shown in the videos below. The small Microtronic program memory cannot hold Emic 2 messages longer than 58 characters. Each character requires at least three machine code instructions (two instructions for loading the upper and lower nibbles of the ASCII character into appropriate registers, followed by a subroutine call which does the +1 conversion, and then sends the two nibbles over the wire to the Emic Arduino, interleaving it with zeros for clocking). Two more subroutines are required for initializing the Emic, and one for sending a CR, causing the Uno to flush its input buffer to the Emic 2, which makes it speak. After all this, there is only program memory left for 58 characters.





I have also coded a simple terminal program for the Emic 2....