Saturday, April 29, 2017

Building add-on cards for the RC2014

Spencer Owen's RC2014 Z80 microcomputer kit is a great starter platform for learning about digital electronics and microprocessors.

Although the Z80 microprocessor in the design is more than 40 years old, having been introduced in the 1970s, the basic concepts still apply in today's world of Raspberry Pis, Arduinos and smartphones.

The RC2014 is based on Grant Searle's "Z80 Computer on 7 chips". Spencer implemented that design in several modules (CPU, memory, clock, serial i/o) and a number of backplane options. Yes, folks, we have a new industry standard bus!!

This provides for a lot of flexibility. You can swap out the basic set of modules for enhanced versions, for example. Spencer has released new versions of the original RAM, ROM and CPU modules with new features. He has also introduced a Pro version of the backplane that adds the additional Z80 signals that were missing from the original backplane design.

I had worked with digital circuits design in past lives both professionally and as a hobbyist. I had also laid out printed circuit boards. So I took to Eagle like duck to water when I decided to redesign Bernd Ulman's Z80_mini.

For the uninitiated, PCB design is pretty addictive. It's like knitting and solving puzzles at the same time.

As can be expected, I didn't stop with the Z80_mini RevB. I went on to design a new RC2016 UART board and a new/improved Z80 processor card.

The 16550 UART board

The original RC2014 serial i/o module is based on the Motorola 68B50. This part was meant for use with Motorola processors and will work fine with 65xx type processors as well. Its bus interface, particularly the use of a bus clock signal (the E signal), limits its flexibility with other types of processors. That Grant was able to put the 6850 with a Z80 running at 7.3728MHz is testimonial to his genius.

The ancientness of the 6850 ACIA also means that it is a very simple device. Newer UARTs like the 16550 have much better performance in terms of maximum line rate (e.g. 1.5Mbps), bus access speeds and enhanced features like on-chip FIFO that reduces the overhead on the main processor.

The Z80_mini board uses the 16550 UART and I was able to run it at 115200 baudrate along with the Z80 running at 20MHz!

The other nice thing about the 16550 UART is its agnostic nature relative to the type of processor. This opens up the door for the use of other microprocessor families in the RC2014.

The current 16550 UART board for the RC2014 has been tested (altho' usual legal disclaimers will apply). It is available from OSH Park at the link below. The Eagle source files can be found on GitHub. The schematic is here. A BIOS along with the ROM images for Monitor/Debugger with/without BASIC can also be found on GitHub under the source and rom folders respectively.

The default port address ranges used are 80H-FFH. Interrupts are supported. However, I did not use an open-collector driver on the INT signal line. This means that the board is cannot be used in conjunction with other UART boards e.g. the original 68B50 (which also uses port address 80H) or SMBaker's SIO boards. A new board design is in the works to resolve some of these limitations.

Note also that the BIOS will configure the UART for 115200 baud operation assuming a 1.8432MHz oscillator.

Parts used are the following:
- Capacitors: all 0.1uF
- DIP14 oscillator
- 16550 or 16C550, the auto-flow control of the 16C550 is not implemented in software
- 6-pin FTDI pin header, angled. A straight pin version will probably lead to fit problems with other cards on the backplane.
- 74HCT04
- Sockets: 40-pin, 14-pin and I also use one for the oscillator

An enhanced Z80 CPU board

If I have one complaint about the original RC2014 design, is that it is based on a minimum part count philosophy. So there is no power-on reset circuit: you probably have to hit the reset button after connecting power. The processor clock is also used to derive the serial i/o baud rate: this means that it is hard to experiment with different microprocessor speeds e.g if you want to turbo charge the Z80 to run it at 20MHz!

This is one reason why I like the Z80_mini: there's a reset circuit and it is designed for two crystal oscillators: one for the 16550 UART and the other drives the Z80. With the Z80_mini, I can run the Z80 at 20MHz and still get 115200 baud from the UART.

The enhanced Z80 board (branded the "Z80 CPU+") presented here aims to solve both the reset and separate clock issues.

The reset circuit is a standard one with an RC+diode combo and a couple of Schmitt triggers. A pushbutton allows for a manual reset. For those who asked, the diode is to drain the capacitor quickly on power cycle.

The INTR and WAIT signals have pull up resistors. The latter is for an eventual wait state generator in case you want to run the Z80 at 20MHz and still be able to use slow peripherals. A jumper option allows you to connect the oscillator output to the CLK signal on the RC2014 bus.

You can see from the picture that I am running a 20MHz Z80 with a 14.31818MHz clock.

The picture below shows the full set up with a 5-slot backplane:

The Z80 card is on the left, followed by the 64KB RAM module, the 16550 UART card and then the Pageable ROM module on the right. The FTDI cable is connected to the UART card and I am using an external 5V power supply.

You can use the CPU card with all existing RC2014 software.

As usual, the source Eagle files are available on GitHub. Boards can be ordered from OSH Park by clicking on the logos below. The schematic is here.

Parts used are:
- Decoupling capacitors: 0.1uF
- Reset capacitor: 10uF to 22uF
- 1N4148 diode
- 10K resistor for the reset circuitry
- 3.3K resistors for R2, R3
- Z80
- DIP14 Oscillator
- 74HCT14
- Reset switch
- Sockets: 40-pin, 14-pin and 14-pin footprint for the oscillator.

16550 UART board:
Order from OSH Park

Enhanced Z80 board:
Order from OSH Park

No comments:

Post a Comment