For my upcoming 6502 CPU based homebrew computer project I need the possibility to program EPROMs and EEPROMs. These chips are parallel memory chips with a 13 to 15 bit wide address bus and a 8 bit databus. Additionally some control lines like /WRITE, /OUTPUT and /ENABLE need to be connected to the EEPROMs.
You can buy a programmer, but they are too expensive for just a simple project. And self made is always much more fun. The whole thing is based on an Arduino Nano, because of the small form factor, the good price and (very important) and already available serial connection via USB.
For 15 address lines, 8 data lines and 3 control lines I need 26 I/O pins, too much for the Nano. But the address lines are only needed as output, so I decided to use 2 74HC595 shift registers to reduce the needed I/O pins from 15 to 3.
The only internal PORT of the Atmeg328 on the Nano that can be completely used with 8 data bits is PORTD (digital Pins 0 to 7). But unfortunately I need pin 0 and 1 for RX/TX, making it a little bit harder to set 8 data bits for the EEPROM.
Here is a picture of the prototype with the Nano V3, 2 74HC595 and a ZIF socket for the EEPROM.
The Nano is stacked on a 600mil DIP socket, that I cut down to 30 pins. So the Nano can be removed and used for other projects.
The "firmware" on the Nano excepts and delivers data through a serial connection to the host computer, using a simple protocol for sending and reading data from and to the EEPROM.
I also wrote a small Java GUI that interacts with my little programmer. At the moment the following features are implemented:
Current Arduino firmware features are:
- Communication at 57600 baud
- Read content of EEPROM as hex data
- Read content of EEPROM as binary data
- Write data binary to EEPROM
- Provide "Version String" with supported commands
Current Java Client Features:
- Load ROM-Files (max 32k) into the application
- select COM-Port
- select EEPROM type (8k,16k,32k) (has influence on the number of bytes read/written)
- burn loaded ROM image to EEPROM
- load data from EEPROM binary to internal buffer
- read hex data from EEPROM (directly written to console window for testing)
- count number of different bytes between internal rom image and data on EEPROM
- clear EEPROM with 0x00
- get the Version Sting from the MEEPROMMER
Features to come:
- Import and Export data in Intel-HEX format
- write only parts of the eeprom instead of the whole chip (from address to address)
- split large ROM images for burning several small EEPROMS with the complete data
- doing "differential" writes (writing only bytes that are different between ROM image and EEPROM)
On the Arduino side I use an 1024 byte buffer to store the data bytes before they are written to the eeprom. An 8k EEPROM can be written within 8 seconds. Fairly fast enough to meet my requirements for a good development life-cycle for the 6502 firmware that should be stored on the EEPROMS.
Here's a short collection of screenshots from the GUI:
GUI after start, selecting different EEPROM types, getting Version String, clearing EEPROM and loading a 8k ROM image:
GUI after making a diff between the cleared EEPROM and the loaded 8k ROM image, showing all 8192 bytes as different:
GUI after writing the ROM image to the EEPROM and then making a diff again.
Now showing that all bytes are equal:
The plan is to build a PCB at the end with some additional features
- MAX232 and DSUB9 connector for RS232 communication without the Arduino USB
- DIP-switches / jumpers for setting the speed of the serial connection
- 20 pin - port with all data, address, RX/TX and control lines for direct access with any other hardware
- external 5V and GND powersupply lines (also on the 20-pin port)
Beside the Java GUI Tool another guy from the 6502.org forum is working on python based command line tools that can be used with the programmer.