Update documentation for new modular code and 8755A support

This commit is contained in:
Tom Nisbet 2018-05-18 00:10:41 -04:00
parent b4eb1afb7c
commit 16ded8af16
10 changed files with 183 additions and 114 deletions

19
README-entension.md Normal file
View File

@ -0,0 +1,19 @@
#Extending the design to new chip families
##Hardware
There are currently two hardware flavors - one for 28C series EEPROMs and one specifically for the Intel 8255A UV EPROM. The 8755A chip uses a multiplexed set of address and data lines that are directly driven by the Arduino. Most other chips will not use this addressing method. The 8755A design aslso includes a circuit to switch the programming voltage under software control. This may be useful for other chips that use non-5V programming voltages, although many of these chips, like the 27 series EPROMS, have a programming voltage that remains for the entire write and verify cycle. For those chips, it may be easier to simply switch the programming voltage manually.
The basic hardware design, used for the 28C family. is much more adaptable to additional chip families. This design uses two shift registers to create 16 dedicated address lines from only 3 arduino pins. This design, plus manual switching of the program voltage, would be very adaptable to EPROMs like the 2716, 2764, 27040, and 272001. The hardware has already been used with these chips for read-only operations.
#Software
The software design is modular, allowing easy extenstion for chips with different programming algoritms. A new class can be added for each new chip family. This class will include code for byte reads, byte writes, and optional block writes, if the chip supports it. All of the chip-specific code will be in this single class.
The basic steps to support a new chip are as follows:
* Create or copy an existing PromDeviceXX class to create a new .cpp and .h file for the chip-specific code.
* Define the pin assignments and implement the chip-specific setAddress, readByte, and burnByte code in the new files. The setAddress code can call the PromAddressDriver code if the shift register address hardware is used.
* If supported, also add chip-specific burnBlock code.
* Be sure that the new files have unique #if defined code that matches the class name.
* Edit Configure.h to add the conditional code includes the new PromDevice subclass.
* Edit TommyPROM.ino to add the conditional code that declares the new device.
Note that after files are added or renamed in the TommyPROM directory, the project needs to be reopened in Arduino IDE to get the changes.

116
README.md
View File

@ -1,66 +1,50 @@
# TommyPROM - An Arduino-based EEPROM programmer
This is a simple EEPROM reader and programmer that can be assembled using an Arduino and a few additional parts. It has been sucessfully built using the Arduino UNO, Micro, and Nano models.
The code is specific to the 28C256 32Kx8 EEPROM, but it would work, with some pin changes with other 5V EEPROMS as well. The PROM-specific code is fairly modular and would be easily adapted. Larger PROMs can be read or written in 64K chunks. Many 5V chips, including UV EPROMs, such as the 2716, can be read with this hardware.
Features include:
* Simple hardware design that can be assembled on a breadboard.
* ROM images transfers using XMODEM - no special host client needed.
* Support for fast block EEPROM writes - a 32K chip will program is just a few seconds.
The project was inspired by the [MEEPROMMER programmer](http://www.ichbinzustaendig.de/dev/meeprommer-en).
![TommyPROM Nano Hardware](docs/TommyPROM-nano.jpg)
## Hardware Design
The hardware uses an Arduino to write data and toggle to control lines with the appropriate timing to access the PROM. A pair of 74LS164 serial to parallel shift registers latch the address lines. Use of the shift registers allows the Arduino to control up to 16 address lines using only 3 output ports.
The basic circuit is as follows:
* Pins D2..D9 are wired to the data lines on the target PROM.
* Pins A0..A2 are wired to the WE, CE, and OE control lines on the target PROM.
* Pins A3..A5 control shift registers to produce the address lines.
The two shift registers can produce a sixteen bit address, although the 28C256 only needs 15 addresses. Chips larger than 64K can be supported by manually tying the additional lines high or low and working with 64K blocks at a time. Additional pins on the Arduino could also be directly tied to additional address lines to do bank selecting.
![TommyPROM Nano Schematic](docs/TommyPROM-nano-sch.png)
## Software Design
The software is designed around several major blocks and classes. It would be cleaner to break the classes out into individual files, but they are kept together so that the entire project can be easily loaded as a simple Arduino project.
### CommandStatus class
This is used to store the execution status of the previous command. It allows the status to be saved (and recalled using the / command) instead of just printing the status at the completion of the command. This was important for debugging XMODEM problems, because the error messages would get eaten as part of the transfer. The class has utility beyond XMODEM because it includes formatting that releives each command from having to build paramterized error messages with multiple prints.
### PromDevice class
The PromDevice class encapsulates all of the communication between the Arduino and the target PROM device. Although the existing code is specific to the 28C256, the constructor has parameters that easily support other chips. The current design has been used to read other chips, including 2764 and 29c040 EPROMs.
The PromDevice class accesses the data bus using direct port writes instead of 8 individual pin accesses. This greatly increases performance, but it makes the code dependent on the particular flavor of Arduino being used. The code can currently be compiled for Uno, Nano, or Micro versions of Arduino hardware.
### Xmodem class
The Xmodem class implements the communications protocols needed to do XMODEM CRC transmit and receive. It calls directly into the PROM read and write code, to the complete files are never stored during the transfer.
### CLI code and command implementation
This code parses input commands and parameters and executes the commands.
A compile-time switch enables additional debug commands that are not needed in normal operation, but are very useful to verify proper operation of the hardware.
## Operation
![TommyPROM Screenshot](docs/tp05.png)
To use the programmer, connect the Arduino USB to the host computer and run a terminal program, such as TeraTerm (Windows) or Minicom (Linux). The Arduino development Serial Monitor can also be used as a terminal initially, but it does not support XMODEM transfers, so the READ and WRITE commands can't be used.
Set the terminal's serial parameters to 115200 baud, 8 bits, no parity, 1 stop bit to match the Arduino. Press the Enter key. If the connection is successful, TommyPROM will display a menu of options.
Most of the commands take a start address parameter, always entered as 4 hex characters. If needed, the end address parameter is also 4 hex characters. For example, the command:
d0000 01ff
dumps memory from 0000H to 01ffH. Note that commands and parameters can be entered in uppercase or lowercase.
The R command is used to read from a PROM and save a binary image on the host. The W command receives a file from the host and writes (burns) it into the device. The R command needs a start and end address. The W command determines the end address from the received file size.
The READ and WRITE command both use XMODEM CRC to complete the file transfers. Once the command is issued to the programmer, the transfer must be started on the host program.
## Further Work
The next project may be a PCB spin of the Nano design with a ZIF socket for easier access to the target chip.
# TommyPROM - An Arduino-based EEPROM programmer
This is a simple EEPROM programmer and reader that can be assembled using an Arduino and a few additional parts. It has been sucessfully built using the Arduino UNO, Micro, and Nano models.
The original code was specific to the 28C256 32Kx8 EEPROM, but it has been extended to also support Intel 8755A EPROMS.
The 28C design can be used with other 5V EEPROMS as well. Many 5V chips, including UV EPROMs, such as the 2716, 2764, 27C2001 and 27C040, can be read, but not written, with the basic hardware. Some pin changes may be needed to get the signals to the correct pins on the device. See the [extension readme](README-extension.md) for details on suggested hardware and software changes needed to support new EPROM and EEPROM families.
The PROM-specific code is modular and can be easily adapted to support additional devices. There are currently drivers and hardware designs for 28C series EEPROMS and the Intel 8755A EPROM. Larger PROMs can be read or written in 64K chunks.
Features include:
* Simple hardware design that can be assembled on a breadboard.
* ROM images transfers using XMODEM - no special host client needed.
* Support for fast block EEPROM writes - a 32K EEPROM will program in just a few seconds.
* Modular software design to easily support other EEPROM and EPROM families.
The project was inspired by the [MEEPROMMER programmer](http://www.ichbinzustaendig.de/dev/meeprommer-en).
![TommyPROM Nano Hardware](docs/TommyPROM-nano.jpg)
## Compiling
Open the TommyPROM.ino file in the Arduino IDE. It should automatically open the cpp and h files as well. The default code programs 28C series chips using Arduino Nano hardware. To use this version, just compile and upload it to the Arduino.
For different Arduino hardware, like UNO or Micro, edit the Configure.h file and uncomment the appropriate ARDUINO_IS_xx line. Only one of these lines should be uncommented. If all of these lines are commented out, the generic bit at a time code is used to write to the data bus. This will work on all Arduinos, but it is slower that the model-specific code.
To use the 8755A version of the code and matching hardware, uncomment PROM_IS_8755A and comment out the other PROM_IS_xx choices.
## Operation
![TommyPROM Screenshot](docs/tp05.png)
To use the programmer, connect the Arduino USB to the host computer and run a terminal program, such as TeraTerm (Windows) or Minicom (Linux). The Arduino development Serial Monitor can also be used as a terminal initially, but it does not support XMODEM transfers, so the READ and WRITE commands can't be used.
Set the terminal's serial parameters to 115200 baud, 8 bits, no parity, 1 stop bit to match the Arduino. Press the Enter key. If the connection is successful, TommyPROM will display a menu of options.
Most of the commands take a start address parameter, always entered as 4 hex characters. If needed, the end address parameter is also 4 hex characters. For example, the command:
d0000 01ff
dumps memory from 0000H to 01ffH. Note that commands and parameters can be entered in uppercase or lowercase.
The R command is used to read from a PROM and save a binary image on the host. The W command receives a file from the host and writes (burns) it into the device. The R command needs a start and end address. The W command determines the end address from the received file size.
The READ and WRITE command both use XMODEM CRC to complete the file transfers. Many terminal programs default to XMODEM Checksum format, so be sure to select XMODEM CRC as the format. Once the READ or WRITE command is issued to the programmer, the transfer must be started on the host program.
The files used for READ and WRITE are simple binary images. This can be created directly by [asm85](http://github.com/TomNisbet/asm85) or can be converted from S-record or Intel HEX using an external utility.
## Further Work
* Add a new PromDevice class for 27 series EPROMS.
* Additional error checking in the CmdLine code.
* Extend the addressing code to use a U32 instead of a U16 to allow chips larger than 64K to be programmed in a single operation.

View File

@ -12,13 +12,15 @@
// compiled in.
#define PROM_IS_28C
//#define PROM_IS_8755
//#define PROM_IS_8755A
#if defined(PROM_IS_28C)
#include "PromDevice28C.h"
#elif defined(PROM_IS_8755)
#include "PromDevice8755.h"
#elif defined(PROM_IS_8755A)
#include "PromDevice8755A.h"
// Additional device support goes here...
// Also add matching code in TommyPROM.ino to declare the new device
#else
#error "No Prom Device defined"
#endif

View File

@ -7,10 +7,10 @@
/*****************************************************************************/
/*****************************************************************************/
/**
* PromDevice class
* PromDevice28C class
*
* Provides the interface to read and write data from a parallel PROM using the
* Arduino.
* Provides the device-specific interface to read and write data from a
* 28C series parallel EEPROM using the Arduino.
*
* Block writes are supported on compatible devices by specifying a blockSize
* in the constructor. Use zero for byte writes.

View File

@ -1,32 +0,0 @@
#ifndef INCLUDE_PROM_DEVICE_8755_H
#define INCLUDE_PROM_DEVICE_8755_H
#include "Arduino.h"
#include "PromDevice.h"
/*****************************************************************************/
/*****************************************************************************/
/**
* PromDevice class
*
* Provides the interface to read and write data from a parallel PROM using the
* Arduino.
*
* Block writes are supported on compatible devices by specifying a blockSize
* in the constructor. Use zero for byte writes.
*/
class PromDevice8755 : public PromDevice
{
public:
PromDevice8755(unsigned long size);
void begin();
protected:
void setAddress(word address);
byte readByte(word address);
bool burnByte(byte value, word address);
};
#endif // #define INCLUDE_PROM_DEVICE_8755_H

View File

@ -1,5 +1,5 @@
#include "Configure.h"
#if defined(PROM_IS_8755)
#if defined(PROM_IS_8755A)
#define CE1 A0
@ -12,13 +12,13 @@
#define VDDCTL 11
PromDevice8755::PromDevice8755(unsigned long size)
PromDevice8755A::PromDevice8755A(unsigned long size)
: PromDevice(size, 0, 0, false)
{
}
void PromDevice8755::begin()
void PromDevice8755A::begin()
{
// Define the data bus as input initially so that it does not put out a
// signal that could collide with output on the data pins of the EEPROM.
@ -52,7 +52,7 @@ void PromDevice8755::begin()
// Set an 11 bit address using the 8 address/data bus lines and three more dedicated
// address lines. The read and burn code will take care of the ALE line
void PromDevice8755::setAddress(word address)
void PromDevice8755A::setAddress(word address)
{
writeDataBus(byte(address & 0xff));
digitalWrite(AD8, address & 0x100 ? HIGH : LOW);
@ -62,7 +62,7 @@ void PromDevice8755::setAddress(word address)
// Read a byte from a given address
byte PromDevice8755::readByte(word address)
byte PromDevice8755A::readByte(word address)
{
byte data = 0;
digitalWrite(RD, HIGH);
@ -89,7 +89,7 @@ byte PromDevice8755::readByte(word address)
// Burn a byte to the chip and verify that it was written.
bool PromDevice8755::burnByte(byte value, word address)
bool PromDevice8755A::burnByte(byte value, word address)
{
// Latch the address and the CE lines
digitalWrite(ALE, HIGH);
@ -111,5 +111,5 @@ bool PromDevice8755::burnByte(byte value, word address)
return readByte(address) == value;
}
#endif // #if defined(PROM_IS_8755)
#endif // #if defined(PROM_IS_8755A)

View File

@ -0,0 +1,32 @@
#ifndef INCLUDE_PROM_DEVICE_8755A_H
#define INCLUDE_PROM_DEVICE_8755A_H
#include "Arduino.h"
#include "PromDevice.h"
/*****************************************************************************/
/*****************************************************************************/
/**
* PromDevice8755A class
*
* Provides the device-specific interface to read and write data from an
* Intel 8755A parallel EPROM using the Arduino.
*
* In addition to the 8755A, the Arduino also controls a voltage switching
* circuit that provides the required programming pulses on the 8755A's Vdd.
*/
class PromDevice8755A : public PromDevice
{
public:
PromDevice8755A(unsigned long size);
void begin();
protected:
void setAddress(word address);
byte readByte(word address);
bool burnByte(byte value, word address);
};
#endif // #define INCLUDE_PROM_DEVICE_8755A_H

39
TommyPROM/README.md Normal file
View File

@ -0,0 +1,39 @@
# Software Design
The software is designed around several major blocks and classes. The code has been broken out into individual files to make it easy to extend the hardware support to additional EPROM and EEPROM families. See the [extension readme](README-extension.md) for details on suggested hardware and software changes needed.
## CommandStatus class
The CommandStatus class stores the execution status of the previous command. It allows the status to be saved (and recalled using the / command) instead of just printing the status at the completion of the command. This was important for debugging XMODEM problems, because the error messages would get eaten as part of the transfer. The class has utility beyond XMODEM because it includes formatting that relieves each command from having to build paramterized error messages with multiple print calls.
## Xmodem class
The Xmodem class implements the communications protocols needed to do XMODEM CRC transmit and receive. It calls directly into the PROM read and write code, to the complete files are never stored during the transfer.
## CLI code and command implementation
This code parses input commands and parameters and executes the commands.
A compile-time switch in Configure.h enables additional debug commands that are not needed in normal operation, but are very useful to verify proper operation of the hardware.
## PromDevice class
The PromDevice class and its subclasses encapsulate all of the communication between the Arduino and the target PROM device.
The PromDevice class can access the data bus using direct port writes instead of 8 individual pin accesses. This greatly increases performance, but it makes the code dependent on the particular flavor of Arduino being used. The code can currently be compiled for Uno, Nano, or Micro versions of Arduino hardware or in a slower hardware-indpendent mode.
The PromDevice class contains common code used by all devices, including the block write code that will break a large write request into a set of properly-aligned smaller blocks for devices that support block writing, or a sequence of infividual byte writes for devices that do not.
Subclasses of the PromDevice class provide the device-specific code. To accomodate the limited memory footprint of the Arduino, only a single subclass will be compiled into the final code. This is controled via switches in the Configure.h file.
The device-specific subclasses are described below. Each class provides pin definitions, byte read, byte burn, and optional block burn code that is specific to the timing of the chip. They also supply a SetAddress method that either calls the built-in code for the shift register hardware or provices device-specific address code.
### PromDevice28C class
Although the existing code is specific to the 28C256, the constructor has parameters that easily support other chips. The current design has been used to read other chips, including 2764 and 29c040 EPROMs.
The 28C code supports fast block writes, allowing a 32K byte chip to be programmed in just a few seconds.
### PromDevice8755A class
The PromDevice8755A class provices the byte read and byte write code, as well as SetAddress code that accomodates the ALE used on this chip. The byte write code controls the Vdd switching hardware that toggles the Vdd pin between the normal 5V value and the 25V programming pulse.
### PromAddressDriver class
Although not actually a subclass of PromDevice, this contains the code to drive the shift registers that provide the address lines. If this hardware is used, the PromDeviceXX class can call this code to implement the SetAddress methods.

View File

@ -29,10 +29,13 @@ CmdStatus cmdStatus;
// Data polling supported
PromDevice28C prom(32 * 1024L, 64, 10, true);
#elif defined(PROM_IS_8755)
// Define a device for an 8755. This has a fixed size of 2K and no
#elif defined(PROM_IS_8755A)
// Define a device for an 8755A. This has a fixed size of 2K and no
// other parameters.
PromDevice8755 prom(2 * 1024L);
PromDevice8755A prom(2 * 1024L);
// Additional device-specific code goes here...
//#elif defined(PROM_IS...
#else
#error "Must define a PROM type in Configure.h"

22
hardware/README.md Normal file
View File

@ -0,0 +1,22 @@
# Hardware Design
# Basic Hardware Version
The hardware uses an Arduino to write data and to toggle control lines with the appropriate timing to access the PROM. A pair of 74LS164 serial to parallel shift registers latch the address lines. Use of the shift registers allows the Arduino to control up to 16 address lines using only 3 output ports.
The basic circuit is as follows:
* Pins D2..D9 are wired to the data lines on the target PROM.
* Pins A0..A2 are wired to the WE, CE, and OE control lines on the target PROM.
* Pins A3..A5 control shift registers to produce the address lines.
The two shift registers can produce a sixteen bit address, although the 28C256 only needs 15 addresses. Chips larger than 64K can be supported by manually tying the additional lines high or low and working with 64K blocks at a time. Additional pins on the Arduino could also be directly tied to additional address lines to do bank selecting.
![TommyPROM Nano Schematic](../docs/TommyPROM-nano-sch.png)
# Intel 8755A Hardware Version
The Intel 8755A uses a multiplexed data and address bus, plus 3 additional address lines. Most Arduino hardware has enough pins to support this directly, so no addtional hardware is needed for addressing. An Arduino pin is also used to drive the ALE latch pin.
The 8755A requires the Vdd pin to be be switched between 5V and 25V during the programming of each byte. A simple transistor circuit is used for this. No voltage regulator circuit is present here for the programming voltage. Because this is designed as a quickly assembled hardware design, a triple output bench supply was used to provide the 25.5V, 5.5V and 5V outputs.
![TommyPROM Nano Schematic](../docs/TommyPROM-8755A-sch.png)