Four Letter Word Generator PART 2 - EEPROM Programmer
In the previous entryof this blog, we started adding a new Four Letter Word generator mode to the VFD Clock.
That entry described the code necessary to generate a data file with four letter words associations and how to access it from EEPROM. One quite important step was skipped: How to get the data file on to the EEPROM.
Now, the reason we needed an EEPROM in the first place is that the required data file is 57kb, and our ATMega328p only has 32kb in total.
The following method should work with just about any arduino: An SD card EEPROM programmer.
- An Arduino (we used a Mega ADK, but a UNO or similar will work just as well)
- A way of hooking up an SD card.
- A 512kbit/64kbyte I2C EEPROM.
There are many breakout boards for SD cards available, have a look here for details:http://arduino.cc/en/Reference/SDCardNotes.
If you don't have a breakout board, it is also possible to attach wires directly to an SD card, but be careful: SD cards are only rated up to 3.3V, so you will need a level converter to control it with the SPI pins on a normal Arduino.
The code is here.
The code is very simplistic: It uses the SD library which is now bundled with the Arduino IDE, reads the file output.dat (must be stored on the root of the sd card) and writes it to the EEPROM one byte at a time. You can get the output.dat file from the GitHub repository linked above, or you can generate it using the included Processing application (as discussed in the previous blog entry).
To test that everything works, we also added an Arduino implementation of the fourletterword generator (you can use this as a base if you want to make your own four letter word device).
The catch with this method is that it is very slow: It takes a few minutes to program one EEPROM. It can probably be sped up quite a bit by writing several bytes at a time to the EEPROM, but we'll leave that for another time.