To build a remake of the UT-88, an 8-bit Soviet DIY computer:
- Get the five hardware components listed above.
- Download the Arduino sketch
mega
from GitHub. - Upload the sketch
mega
to your Arduino Mega 2560 using the Arduino IDE. - Assemble the computer as shown in the photo above. The 4x4 keypad should be connected to sockets A8..A15.
That's it! Just be aware that it can take the Arduino Mega 2560 about five second to fully wake up. You may also need to adjust the brightness of the LCD screen with a screwdriver.
You should see 11
in the top middle of the LCD, which means that the computer is ready for your commands (“directives”). You can return to this mode at any time by pressing Right
to reset the computer.
You can start playing with the computer by pressing 3
(key S4) to test its display or 4
(key S5) to test its RAM (which starts from address C000
)—it should display C400
as the first address that doesn’t belong to its RAM.
- Z80 CPU operating at roughly 0.5 to 0.6 MHz on average (no consistent clock).
- 4 kB ROM at addresses
0000
to0FFF
, which stores the monitor and helpful subroutines. - 1 kB RAM at addresses
C000
toC3FF
, extendable (in the sketch) up to about 7 kB, since the Arduino Mega 2560 has 8 kB of SRAM. - 4 kB EEPROM, split in four sections ("tapes") to permanently store user code—a replacement of a cassette tape recorder.
- Keyboard: 16 digits
0
toF
(keys S1 to S16),Select
("step backward") to edit currently viewed memory byte,Left
to select the current "tape",Up
to upload the RAM to the current "tape",Down
to download the current "tape" to the RAM,Right
resets the UT-88,Reset
resets the Arduino Mega 2560 (and clears the RAM). - Display: 16x2 LCD display emulating six hexadecimal digits split in two groups of four and two digits.
(From here).
Heads-up: Don't use the cassette tape directives 9
and A
. Instead, use the EEPROM "tape" buttons Up
and Down
, respectively.
Directive | Directive | Description
Key | Parameters |
==========|==============|=============================================
0 | ADDR | Write data to RAM starting from address ADDR
1 | — | Write data to RAM starting from address C000
2 | — | Read data from RAM starting from address C000
3 | — | Indicator test
4 | — | RAM test
5 | ADDR | Read data from RAM starting from address ADDR
6 | — | Start program from address C000
7 | ADDR | Start program from address ADDR
8 | ADDR1, ADDR2 | Checksum of data from ADDR1 to ADDR2
9 | ADDR1, ADDR2 | Write data to tape from ADDR1 to ADDR2
A | ADDR | Read data from tape with offset equal to ADDR
B | — | Time indication
C | C3FD | Set time: enter C3FD, seconds (00-59), minutes (00-59), hours (00-23). Press Right to set the time.
Programming Tips- To display a byte (in hexadecimal) in the leftmost position on the LCD, store the byte in memory location
9002
. To change the remaining two LCD indicators, store bytes in memory locations9001
and9000
, respectively. - To enter a byte from the keyboard into the accumulator
A
, use theRST 2
instruction (opcodeD7
). - To poll the keyboard state, use the
IN A0
instruction (opcodesDB A0
) orRST 4
(opcodeE7
). This will put a value from01
to0F
into the accumulatorA
if the corresponding key (from S2 to S16) is pressed,10
if the "0" key (S1) is pressed,80
if the "step backward" key is pressed, and00
if none of these 17 keys are pressed. - To delay for one second, use the
RST 3
(opcodeDF
) instruction. - To display the contents of the registers HL and A, use the
RST 5
instruction (opcodeEF
). - To enter two bytes into the register
DE
, use theRST 6
instruction (opcodeF8
). - To end your program, use the
RST 0
instruction (opcodeC8
).
Some time ago I felt an irresistible urge to assemble a 1988 Soviet DIY computer, the UT-88, which is based on the Intel 8080 CPU and looks like this:
But instead of sourcing vintage ICs, programming ancient ROMs, and soldering everything together, I decided to take a more modern approach. I kept the CPU (well, almost—I replaced the Intel 8080 with a Zilog Z80) but replaced everything else with an Arduino Mega 2560, a 16x2 LCD shield, and a pre-made 4x4 keypad. This not only drastically reduced the component count but also eliminated the need for soldering.
Why Arduino Mega 2560The Arduino Mega 2560 is a natural choice for this project because it combines an easily programmable MCU with enough pins to interact with the 40-pin Z80 CPU and operates at 5V—making it ideal for direct interaction with the Z80 without needing logic-level converters.
Additionally, there are two similar projects that use the Arduino Mega 2560, to which this project owes a great deal:
- The project "Retro Computing with Arduino Mega and a Z80 processor" demonstrated that it's possible to directly connect a Z80 to an Arduino Mega 2560 and have the MCU drive the CPU.
- The RetroShield Z80, along with working examples (basic test, BASIC, monitors), showed exactly how to practically drive the Z80.
The two projects above use a 0.1 MHz timer to clock the Z80, which is a few dozen times slower than a normal clock rate for the Z80.
I don't use a timer to clock the Z80 at all.
I just set the Z80 clock signal high, transfer a byte between the Z80 and the Arduino Mega 2560, set the clock signal low for about a microsecond, and repeat this process. As a result, the average clock rate is about 0.5..0.6 MHz—not a bad improvement over the 0.1 MHz and not a significant slowdown compared to the original UT-88's Intel 8080 at 2 MHz.
Bonus: Upgrade with a Bigger Display and KeyboardIf you find the base configuration of UT-88 limiting, take a look at my next project: Add Display and Keyboard to Any Arduino Project (e.g. UT-88)
Comments