Serial Eeprom Programmer Arduino
I really need an eeprom programmer, but their quite expensive and I have heard some break within just a couple of weeks! Anyway I have had my arduino uno for a while and havn't found a project for it yet so I want to try making my own eeprom programmer with it.
/****************************************************** |
Arduino EEPROM Read-Write Test |
by Ted Hayes 2012 |
ted.hayes@liminastudio.com |
Demonstrates the usage of the EEPROM Library for checking the state of a single value, |
changing it, and resetting it. To use: |
1) Put a momentary switch between ground and pin 11 on your Arduino. |
2) Upload this program to it. |
3) Open the serial monitor |
4) You should see: |
Starting; current EEPROM value is 0 |
EEPROM byte not set yet; Writing... |
Done. |
5) Now press the reset button on your Arduino and keep the serial monitor open. |
You should see: |
Starting; current EEPROM value is 1 |
EEPROM byte was set! |
Done. |
6) Press your momentary switch, and you should see: |
Resetting EEPROM value |
7) Now press the reset button one more time, and you should see: |
Starting; current EEPROM value is 0 |
EEPROM byte not set yet; Writing... |
Done. |
That's it! Remember that the EEPROM on ATmega chips has a specified life of 100,000 |
write/erase cycles, so be careful about putting writes/erases in loops, etc.. |
******************************************************/ |
#include<EEPROM.h> |
#definePIN_SWITCH11 |
int lastSwitch = HIGH; |
boolean didReset = false; |
voidsetup(){ |
Serial.begin(9600); |
pinMode(PIN_SWITCH, INPUT); |
digitalWrite(PIN_SWITCH, HIGH); // set internal pull-up resistor |
int val = EEPROM.read(0); |
Serial.print('Starting; current EEPROM value is '); |
Serial.println(val); |
if(val != 1){ |
Serial.println('EEPROM byte not set yet; Writing...'); |
EEPROM.write(0, 1); |
} elseif (val 1){ |
Serial.println('EEPROM byte was set!'); |
} |
Serial.println('Done.'); |
} |
voidloop(){ |
int currentSwitch = digitalRead(PIN_SWITCH); |
if(currentSwitch LOW && lastSwitch != currentSwitch && !didReset){ |
// switch has changed state |
// didReset is a simple form of debouncing, which prevents |
// this from being run too many times |
Serial.println('Resetting EEPROM value'); |
EEPROM.write(0, 0); |
didReset = true; |
} |
} |
A couple years ago I spent a good week wiring up a fairly complex EPROM programmer so I could burn a prom for my jeeps EFI system. Today I ran across this $5 version. build built by Jay Kominek He uses shift registers to handle the addressing and IO lines, all driven directly by the parallel port. There’s no way to escape the number of pins that have to be wired up, but the schematic itself is pretty simple.
[By the way, arcade supply shops are a great source for cheap UV erase EPROMS.]
Eeprom Programmer
[Update: I’d forgotten about the voltage change (3 vs 5 if I remember) needed to write UV EPROMS vs EEPROMS. With a little mod, you can certainly use this for EPROMS as well.]