# Digital Circuits 6: An EPROM Emulator

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/053/677/medium800/components_EPROM.jpg?1526080666 The classic 2716 2Kx8 EPROM.)

I recently designed and breadboarded a simple Z80 based computer. This was the sort of thing I did for fun and profit years ago. This time it was, well, for fun and profit. But it was a little different. Back in the day I had a drawer full of Erasable Programmable Read-Only memory chips (EPROMs), as well as an EPROM eraser and programmer\*.&nbsp; &nbsp;This time I had none of that. So I'd have to get inventive.

When I designed the system, I put in 2K of ROM/EPROM and 2K of static ram. Naturally when I bought parts, I got extras. So, that meant I had an extra 2K static ram chip sitting in a drawer. That's a powerful thing: having extra parts sitting in drawers. What I decided to do was build an EPROM emulator using that ram chip, some transistor/transistor (TTL) logic and a microcontroller board.

I was using a Z80 assembler (`z80asm` from&nbsp;[z80pack](http://www.autometer.de/unix4fun/z80pack/)) on Linux to write code for the Z80, so using a microSD card seemed a reasonable way to get code from Linux to the emulator. Once I had decided to do that, I needed a way to navigate the file system on the card, select a binary file, and load it onto the RAM in the emulator.&nbsp; See how things snowball!

To make the project a bit simpler and more modular, I chose to divide it into two separate parts: the controller/user interface (UI), and the emulator. To maximize the flexibility of that separation, I decided to connect them using an I<sup>2</sup>C bus. That proved to be a very good choice as I went through several iterations using different microcontroller boards: from an Arduino Mega2620 to an ItsyBisty M0 Express and finally to an Metro M4 Express.

While I designed this project to support my work on a Z80 system, it can be used to replace a 2716 EPROM in any system. In this guide, I'll call that system the _host_.

<sup>* I'm planning to build a new take on an EPROM programmer sometime in the near future which will share some features of this project, and in some ways could be considered as Part 2. It will most likely use the same controller/ui design.</sup>

## Parts Used
### Part: MicroSD card breakout board+
quantity: 1
MicroSD card breakout board+
[MicroSD card breakout board+](https://www.adafruit.com/product/254)

### Part: Monochrome 128x32 I2C OLED graphic display
quantity: 1
Monochrome 128x32 I2C OLED graphic display
[Monochrome 128x32 I2C OLED graphic display](https://www.adafruit.com/product/931)

### Part: Rotary Encoder + Extras
quantity: 1
Rotary Encoder + Extras
[Rotary Encoder + Extras](https://www.adafruit.com/product/377)

### Part: Adafruit Metro M4
quantity: 1
Microchip ATSAMD51
[Adafruit Metro M4](https://www.adafruit.com/product/3382)

### Part: 4-channel I2C-safe Bi-directional Logic Level Converter
quantity: 1
4-channel I2C-safe Bi-directional Logic Level Converter - BSS138
[4-channel I2C-safe Bi-directional Logic Level Converter](https://www.adafruit.com/product/757)

### Part: MCP23017 - i2c 16 input/output port expander chip
quantity: 1
MCP23017 - i2c 16 input/output port expander
[MCP23017 - i2c 16 input/output port expander chip](https://www.adafruit.com/product/732)

### Part: Silicone Cover Stranded-Core Wire 30AWG
quantity: 1
Silicone Cover Stranded-Core Wire - 50ft 30AWG Black
[Silicone Cover Stranded-Core Wire 30AWG](https://www.adafruit.com/product/3164)

- [Next Page](https://learn.adafruit.com/digital-circuits-6-eprom-emulator/interface-hardware-v2.md)

## Featured Products

### MicroSD card breakout board+

[MicroSD card breakout board+](https://www.adafruit.com/product/254)
Not just a simple breakout board, this microSD adapter goes the extra mile - designed for ease of use.

- Onboard 5v-\>3v regulator provides 150mA for power-hungry cards
- 3v level shifting means you can use this with ease on either 3v or 5v systems
- Uses a proper level...

In Stock
[Buy Now](https://www.adafruit.com/product/254)
[Related Guides to the Product](https://learn.adafruit.com/products/254/guides)
### Monochrome 128x32 I2C OLED graphic display

[Monochrome 128x32 I2C OLED graphic display](https://www.adafruit.com/product/931)
These displays are small, only about 1" diagonal, but very readable due to the high contrast of an OLED display. This display is made of 128x32 individual white OLED pixels, each one is turned on or off by the controller chip. Because the display makes its own light, no backlight is...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/931)
[Related Guides to the Product](https://learn.adafruit.com/products/931/guides)
### Rotary Encoder + Extras

[Rotary Encoder + Extras](https://www.adafruit.com/product/377)
This rotary encoder is the best of the best, it's a high-quality 24-pulse encoder, with detents and a nice feel. It is panel mountable for placement in a box, or you can plug it into a breadboard (just cut/bend the two mechanical side tabs.) We also include a nice soft-touch knob with an...

In Stock
[Buy Now](https://www.adafruit.com/product/377)
[Related Guides to the Product](https://learn.adafruit.com/products/377/guides)
### Adafruit Metro M4 feat. Microchip ATSAMD51

[Adafruit Metro M4 feat. Microchip ATSAMD51](https://www.adafruit.com/product/3382)
Are you ready? Really ready? Cause here comes the fastest, most powerful Metro ever. The **Adafruit Metro M4** featuring the **Microchip ATSAMD51**. This Metro is like a bullet train, with its 120MHz Cortex M4 with floating point support. Your code will zig and zag...

In Stock
[Buy Now](https://www.adafruit.com/product/3382)
[Related Guides to the Product](https://learn.adafruit.com/products/3382/guides)
### 4-channel I2C-safe Bi-directional Logic Level Converter

[4-channel I2C-safe Bi-directional Logic Level Converter](https://www.adafruit.com/product/757)
Because the Arduino (and Basic Stamp) are 5V devices, and most modern sensors, displays, flashcards, and modes are 3.3V-only, many makers find that they need to perform level shifting/conversion to protect the 3.3V device from 5V. Here we've got a **&nbsp;4-channel I2C-safe...**

In Stock
[Buy Now](https://www.adafruit.com/product/757)
[Related Guides to the Product](https://learn.adafruit.com/products/757/guides)
### MCP23017 - i2c 16 input/output port expander

[MCP23017 - i2c 16 input/output port expander](https://www.adafruit.com/product/732)
Add another 16 pins to your microcontroller using an MCP23017 port expander. The MCP23017 uses two i2c pins (these can be shared with other i2c devices), and in exchange gives you 16 general purpose pins. You can set each of 16 pins to be input, output, or input with a pullup. There's even...

In Stock
[Buy Now](https://www.adafruit.com/product/732)
[Related Guides to the Product](https://learn.adafruit.com/products/732/guides)
### Silicone Cover Stranded-Core Wire - 50ft 30AWG Black

[Silicone Cover Stranded-Core Wire - 50ft 30AWG Black](https://www.adafruit.com/product/3164)
Silicone-sheathing wire is super-flexible and soft, and its also strong! Able to handle up to 200°C and up to 600V, it will do when PVC covered wire wimps out. We like this wire for being extremely supple and flexible, so it is great for wearables or projects where the wire-harness has to...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3164)
[Related Guides to the Product](https://learn.adafruit.com/products/3164/guides)

## Related Guides

- [Adafruit Metro M4 Express featuring ATSAMD51](https://learn.adafruit.com/adafruit-metro-m4-express-featuring-atsamd51.md)
- [Quickstart using Adafruit eInk/ePaper displays with CircuitPython](https://learn.adafruit.com/quickstart-using-adafruit-eink-epaper-displays-with-circuitpython.md)
- [Adafruit 1-Wire Thermocouple Amplifier - MAX31850K](https://learn.adafruit.com/adafruit-1-wire-thermocouple-amplifier-max31850k.md)
- [Gemma-Powered NeoPixel LED Sound Reactive Drums](https://learn.adafruit.com/gemma-powered-neopixel-led-sound-reactive-drums.md)
- [3D Printed LED Microphone Flag](https://learn.adafruit.com/3d-printed-led-microphone-flag.md)
- [Light Meter](https://learn.adafruit.com/light-meter.md)
- [Esenciales para CircuitPython](https://learn.adafruit.com/esenciales-para-circuitpython.md)
- [Micro SD Card Breakout Board Tutorial](https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial.md)
- [3D Printed LED Buckle](https://learn.adafruit.com/3d-printed-led-buckle.md)
- [A CLI in CircuitPython](https://learn.adafruit.com/a-cli-in-circuitpython.md)
- [Native MP3 decoding on Arduino](https://learn.adafruit.com/native-mp3-decoding-on-arduino.md)
- [Which CircuitPython Board is Right for You?](https://learn.adafruit.com/choose-your-circuitpython-board.md)
- [CircuitPython 101: Working with Lists, Iterators and Generators](https://learn.adafruit.com/circuitpython-101-list-and-things-iterators-generators.md)
- [A Logger for CircuitPython](https://learn.adafruit.com/a-logger-for-circuitpython.md)
- [Adafruit AirLift Shield - ESP32 WiFi Co-Processor](https://learn.adafruit.com/adafruit-airlift-shield-esp32-wifi-co-processor.md)
- [2.8" TFT Touchscreen](https://learn.adafruit.com/2-8-tft-touchscreen.md)
