ZX Interface Z - The Hardware, part 2

How many volts, you say?

Welcome to the second part of the ZX Interface Z hardware overview. On the first part we looked with some detail at the expansion connector and the power supplies. In this blog post we will dwelve into other areas of the hardware.

Voltage level converters

Digital designs come in several flavours. One thing that can (and usually differ) from one digital design and other digital design are the logic standards used. Some of you might already have heard of TTL and CMOS, and maybe ECL technologies. Each of these technologies usually implements a different logic standard, where voltages which are used to represent 0 (zero) and 1 (one) vary according to a certain "range". Many other technologies exist now, and also many other logic standards, such as RSDS, LVPECL, LVDS, SSTL, too many to enumerate here. 

Going back to the logic standard voltages, the ZX Spectrum use mainly 5V for the logic, since it is almost entirely made out of TTL. Some chips inside the Spectrum require also +12V and -5V: the lower RAM, which I suspect is based on NMOS technology (as a side note, CMOS is a combination of NMOS and PMOS transistors). The technology has moved on, and it's now very unusual to find TTL devices at all, and most integrated circuits implement only CMOS levels, with some support for interfacing to TTL devices. TTL required 5V nominally as the supply and as logic level, but CMOS allowed voltage to drop to unusually low supplies. So, most digital systems out there use 3.3V for the external logic standard (2.5V and 1.2V are also very common).

The FPGA and the ESP32 CPU used on ZX Interface Z are not able to handle a 5V logic standard. The highest voltage that one can present at the CPU and FPGA are 3.3V. Placing 5V at the FPGA or CPU pins will cause you to understand what "blue smoke" is all about. This means that neither the FPGA or the CPU can be directly connected to the ZX Spectrum expansion connector - it requires a bit of "glue logic" to connect them so they are happy with each other.

So, welcome to the voltage level converters. Which is not as simple as one would expect, let's see why.

The conversion is obtained by using four 74LCX245FT integrated circuits. These are octal buffers (meaning each one incorporates eight individual one-bit buffers) and are powered by the on-board nominal 3.3V. Note the unusual "LCX" and "FT" terminology in the chip name - this is no ordinary 74xx series integrated circuit, but rather a CMOS TTL-compatible, 5V tolerant buffer. This means that despite being powered by 3.3V, one can apply 5V on its inputs without damaging the circuit (here is the datasheet if you want to read it in more detail). The outputs of the buffer will use 3.3V logic since it cannot even be powered by 5V.
On the circuit above, the lines connecting to the expansion connector of the ZX Spectrum are at the left-side of each buffer, and each signal has a 33 ohm series resistor (more on the resistor later).
Although the buffers are bi-directional, the buffers used on the address and control lines are forced in a single direction by tying the DIR pin to +3.3V. This means that we can "read" the address lines from the ZX Spectrum but not manipulate them. This also means that, since we only read the address lines, and since the buffer supports the 5V inputs and outputs 3.3V on the right side, we are safe, and we can connect the buffer outputs to the FPGA with no more logic in between.
For the data lines, we need to read and write the data on the bus, so we change the bus direction using the signal D_BUS_DIR which comes from the FPGA. We also drive the enable pin for this buffer from the FPGA to avoid driving the BUS at powerup (R24 will disable the buffer when the FPGA is still being programmed).
But as we said, the buffer is only capable of outputting 3.3V, and the Spectrum is 5V. So, how and why does it work?
The answer now lies within the technology used on the ZX Spectum - TTL. In 5V TTL technology, the voltage at the inputs defines whether a "zero" or a "one" is present. For each TTL input a "zero" is defined as a voltage between 0 and 0.8V, and a "one" is defined as a voltage betweem 2V (!!) and 5V. These two values (0.8V and 2V) are called VIL (low-level input voltage) and VIH (high-level input voltage). If we look at the outputs from our buffers (see the datasheet above), you can see that the logic-zero output is below 0.55V (VOL@3.0V) and logic-one is above 2.4V (VOH@3.0V). These are worst-case values, and give us a margin of about 350mV for the "zero" and 400mV for the "one" (plus we use 3.3V, not 3.0V). Not much, but sufficient for the ZX Spectrum to interpret our data correctly.
The series resistors on the buffer inputs are there to protect against voltage spikes, which might cause excessive voltage at the buffer inputs due to inrush current.

The back expansion connector

The ZX Interface Z has itself an expansion connector on the back, which can be used to extend the functionality of the board.

The expansion consists of an edge connector with 18 connections (4 power and 14 signal).On this connector you can find ground (on both sides), 5V rail (direclty from ZX Spectrum regulator), and 3.3V to power the expansion board. The digital data signals function depends on the FPGA firmware, so you can design your own expansion cards and connect it to whatever you might want.
One of the signals (EXT13) is however reserved, and it's meant to automatically detect which type of card is connected to the expansion slot.
Also in blue you will find some labels with odd terminology. These labels depict the function they have in the FPGA side, like "T10N", which roughly means "T10, N polarity". You will find that they come in "N" and "P" pairs - this is because they can be differential signals (LVDS) so you can perform high-speed interfacing with the expansion board (HDMI is being thought of).

The most common expansion card is the VGA+Audio adaptor, which I will also blog about.

What's next?

We looked at the voltage level converters and the board own expansion connector. On next blog posts, we will look in detail into these areas of the hardware:

  • Buttons and LEDs
  • Debugging and the USB-Serial programmer
  • SD Card 
  • ESP32 module
  • FPGA (*)
  • USB Host
  • SDRAM (memory)
(*) For the FPGA also a series of blog posts will explain in detail what goes around inside. Which is a lot. Quite a lot.

Hope you enjoyed this second blog post. Please leave any comments here or on the facebook page at https://www.facebook.com/zxinterfacez.

Comments

Popular posts from this blog

ZX Interface Z - The Hardware, part 3

ZX Interface Z - The Hardware, part 1