Arduino-based EEPROM programmer for the AT28C64B (8 KiB) and AT28C256 (32 KiB) EEPROMs.
The EEPROM programmer consists of 2 parts: A Programmer Device based consiting of an Arduino Mega 2560 with a daughter-board containing an IC socket for the EEPROM chips (DIP-28P6). This Programmer Device interacts with a Client Program on the PC.
The programmer supports enabling and disabling of the Software Data Protection (Write Lockout) mode on the EEPROM.
This feature can be used as a standalone command (<cmd> lock and <cmd> unlock), and in combination with other write
operations.
It is even possible to unlock an EEPROM, write to it, and lock it again in a single operation.
Since the programmer supports 2 different sizes of EEPROMs, the user would have to indicate what type is connected to the programmer for any given command. The Client Program is however capable of "guessing" the safe EEPROM size for most operations. In some cases this may lead to additional unnecessary write cycles on smaller chips (which we consider to be a negligible downside) and potentially increased operation durations.
The following pseudo-C shows the test routine to definitely determine the EEPROM size. This test can be performed both destructively and non-desctructively. In all cases the EEPROM must be unlocked beforehand.
bool isLargeChip(bool preserveData) {
address adr = random(0x0000, 0x2000);
byte data = read(adr);
// if there's different data in the higher "blocks", it obviously is a large chip
if (data != read(adr + 0x2000)) {
return true;
}
// modify low byte, check if high byte changes too
write(adr, ~data);
//high byte unchanged means large chip
bool result = (data == read(adr + 0x2000));
if (preserveData) {
write(adr, data);
}
return result;
}The live mode creates an interactive terminal between the user and the Programmer Device for interactive
manipulation
of the EEPROM.
This is primarily used for testing or analysis purposes.
Lock- and Unlock-Flags are not respected in this mode (there are manual unlock and lock commands), neither are size
flags as they are irrelevant in this mode.
The erase opration writes 0xFF to every byte of the EEPROM memory.
When an explicit size flag is set, the corresponding deletion logic is performed.
Otherwise, we perform a destructive size test before flashing the EEPROM.
The dump command reads the entire contents of the EEPROM.
If a size is specified, the output file has the matching size.
If no size is specified, the EEPROM is read as if it were a 32 KiB one.
After that the data is checked.
If all 4 8 KiB blocks match exactly, we assume to have read an 8 KiB EEPROM and write the output file with the
matching size.
If there are any differences in the blocks, we save the entire 32 KiB.
The flash command writes a binary file to the EEPROM.
In cases where no chip size is provided, we perform a size test before flashing the EEPROM. It is always possible to write a binary file to the EEPROM that is smaller than the capacity of the EEPROM. In that case, the memory locations not defined by the file remain unchanged.
It is never possible to write a file to an EEPROM that does not have enough capacity.
While the EEPROMs can be unlocked during write operations (erase / flash), a dedicated unlock command is also
provided.
Size information is not required for this operation.
While the EEPROMs can be locked during write operations (erase / flash), a dedicated lock command is also provided.
Size information is not required for this operation.