malinov.com

Malinov Family Web Presence

Designing Homebrew Retro Computers: General Notes

Initially published on 2024-01-25

These are my notes on designing your own homebrew retro computer. I use the “homebrew retro computers” term for modern hobbyists designs that typically based on older, 1970’s-1980’s processors and other components. Often newer components used as well out of convenience or necessity.

Introduction

Designing and building homebrew retro computers lately became a popular hobby. The community around this hobby is quite diverse. From professional electrical engineers to software people (like me) to people that don’t have much to do with electronics or computers but would like to experiment. Therefore, the designs and their goals vary significantly. And as it would be expected, many people base their projects on projects and computer systems that existed previously. Unfortunately, often people replicate inefficient or poor designs, other times people ask questions that were already answered elsewhere. In this and subsequent articles, I will try to describe some of the best known-methods and some of the pitfalls to avoid.

Clock Sources

In older 1970’s-1980’s designs it was common to build oscillators using logic gates and quartz crystal resonators. Integrated oscillators were not existent or expensive. Nowadays, integrated oscillators with TTL/CMOS level outputs are common and come in convenient to use “full can” - DIP-14 or “half can” - DIP-8 packages, as well as in a variety of SMD packages. I would strongly recommend using these integrated oscillators and avoid building your own oscillators.

Building Oscillator Using Logic Gates

If you do insist on building your own oscillator there are several things to be aware of:

  1. There are two popular oscillator circuits: parallel resonant oscillator circuit also known as Pierce oscillator, and series resonant oscillator circuit. This article give a good description of both circuits. A few things to be aware of:
    • The choice between parallel and series circuit often depends on the logic gate family used: the parallel circuit works better with CMOS logic, while the series circuit works better with TTL/TTL-LS logic.
    • In both cases avoid using Schmitt trigger gates, as they lack the linear region the oscillator needs to operate. If using CMOS, ideally use unbuffered gates, such as 74HCU04, although 74HC04 and even 74HCT might work as well.
    • Crystal resonators come in parallel and series varieties and the resonator type should match the circuit type. Otherwise, the circuit’s frequency will be slightly off.
  2. Use appropriate load capacitors for parallel resonant oscillator circuits. There is an equation to calculate the proper values, for example, it is documented in this article.
  3. Crystal oscillator circuits are sensitive to EMI. They generally don’t work well when assembled on a breadboard. When designing a PCB, to improve the stability, keep the crystal as close as possible to the logic IC, and have ground fill around the crystal.
  4. Some CPUs, SoC, and peripheral controllers, such as clock generators, UARTs, floppy disk controllers, and real time clocks come with a built-in oscillator circuit. Such ICs will typically have two pins to connect a quartz resonator labeled X1 and X2. The considerations described above also apply to these ICs.
    • Most modern ICs are CMOS based and implement parallel resonant oscillator circuits. Use parallel crystals and appropriate load capacitors. Keep the crystal as close to the IC as possible.
    • Some ICs, particularly these released in late 1970’s and early 1980’s, came in TTL, NMOS or CMOS versions. The crystal resonator circuit for the same IC implemented using different logic families will be different. For example:
    • The 8085 microprocessor was originally built using NMOS logic. It’s CMOS version - 80C85 was released later. Both have a parallel resonant circuit, but their recommended crystal oscillator circuits differ slightly.
    • The 8284 clock generator for 8086/8088 microprocessors was originally built using TTL-LS logic and uses a series resonant oscillator circuit. The 82C84, a CMOS version of 8284, uses a parallel resonant circuit. * Consult the IC’s datasheet for the oscillator selection and circuit implementation. * Most of these ICs can also accept TTL/CMOS input clock instead of using the built-in crystal oscillator. That might be a good choice if you have several ICs that need the same clock, or otherwise have the clock already available.

Reset Circuit

A computer system needs a reset circuit to reset the CPU and other devices’ registers and other memory cells to known default values and enable correct operation. The reset circuit typically provides a delayed reset signal after the power has been applied to the system. This delay allows the power supply voltages to stabilize, the oscillators to start running, and the processors and other peripheral controllers to run for a several clock cycles to reset their memory cells. In many cases, the reset circuit also provides a reset switch, that allows the user to reset the system at any time.

Older designs commonly use an RC delay circuit with Schmitt trigger gates to obtain the properly formed logic signal. While such an RC circuit remains valid approach, nowadays there is a variety of specialized reset and CPU supervisory ICs that provide several benefits over an RC circuit:

Suggested Reset and CPU Supervisory ICs

This list is not exhaustive. It includes some of the CPU supervisory ICs already used in hobbyists’ projects.

Implementing an RC-based Reset Circuit

Here are some recommendations for implementing an RC based reset circuit:

Power Supplies and Power Distribution

Currently regulated, compact and powerful switch mode 5V power supplies are cheaply available, and they are the preferred way to power homebrew retro computer systems. It should be noted that while USB chargers might appear a good power supply option, some of them do not provide good output regulation, and can output slightly higher than 5V voltages. My recommendation is to avoid these USB chargers.

If the design requires other than 5V voltages, a DC-DC converter can be used. There are ready made DC-DC converters available, or alternatively a DC-DC converter can be implemented using ICs such as MC34063A

A few notes about the power distribution on the system’s board:

Serial Ports

Many retro home brew computer systems use RS-232 serial ports as to interact with a user as a console. There are several considerations when implementing RS-232 serial ports.

UART Selection

UART selection depends on the design goals, CPU family used and other parameters. Here are some popular choices, their advantages, and drawbacks:

RS-232 Signal Levels

Original RS-232 specification uses the input levels of -3V to -15V for logic ‘1’ and +3V to +15V for logic ‘0’. In computers common output levels used are -10V to -12V for logic ‘1’ and +10V to +12V for logic ‘0’. Many production systems and older homebrew systems used power supplies with -12V and +12V outputs in addition +5V used by the logic ICs. Since 1990’s RS-232 transmitter ICs with built-in charge pumps capable of operating from a single 5V voltage are available. Common examples include MAX232, MAX202, MAX232A, MAX3232 and similar ICs. Most of these ICs require external capacitors for the charge pump. The capacitance can vary depending on the IC used. Please be sure to check the datasheet for the correct capacitance values.

Another approach common in recent years is to provide unbuffered TTL level signals and to use a serial-to-USB converter for interfacing the system to a personal computer. It should be noted that UARTs provide limited ESD protection, and this connection is not as robust as using properly buffered RS-232 signals. It is a good idea to at least use resistors in series with the signals to reduce the potential current flowing through the UART IC is case of short-circuits between signals. I am also not a big fan of pin header connectors typically used in this case. These connectors tend to be not polarized and also, they are not rated for multiple connection cycles.

Flow Control

Simple RS-232 implementation requires only three signals - RX, TX and ground. More complete implementations, particularly those intended to be used with modems, include 2-4 additional modem, line status, and flow control signals. Unless using your system with modems, most of these signals are not required. With that being said, I do recommend implementing RTS and CTS signals. These signals are used for flow control and become really useful when transferring large amounts of “burst” data from a typically faster PC to a slower homebrew vintage systems. Sending files using XMODEM protocol and simply coping and pasting text from the host computer work much better with RTS and CTS flow control and might be a complete PITA without it.

Extension Busses

Many homebrew vintage systems are modular, and designers would like to have a way to extend their systems in the future. Therefore, these systems will include an extension bus. There are multiple considerations when designing data busses. Also, there are many industry standard bus specifications already exist, and thoroughly documented. In addition, there are several homebrew busses that appeared recently. Yet, in some cases, designers of homebrew system will create yet another bus just for their own design.

Before creating your own bus, check the existing busses, their advantages and disadvantages, and check if any of these will be suitable for your design:

Existing Extension Busses

Bus Implementation Recommendations

Here are my recommendations if for whatever reason you want to create yet another bus for your design

Todo

Trademarks