Introduction: Disassembly of Arduino EEPROM
Have you ever found the need to see what is on the EEPROM of your Arduino?
Or wanted to find the Arduino that you stored data on but not sure which one it is in your collection of different Arduinos?
In a previous Instructable, I had a combination number stored to the EEPROM.
To cut a long story short, someone built the project, ran it, something was wrong somewhere, fixed it and ran it again. However in the initial run they had managed to store ‘something’ in the EEPROM and as it was for a combination ‘thingy’ they got locked out. There was a default combination and that needed resetting, but once there was a combination in the EEPROM, the default is ignored.
Anyway, he/she eventually managed to get around it with a little help. But this got me thinking.
If that person could have interrogated the EEPROM on their Arduino, it could have been a quicker fix.
So, this little project was born!
Step 1: Quick Code Explanation
All that is required for this project is an Arduino and a connection to a computer. Not an LED in sight.
The code is well commented, but I will give you a quick run through here.
The attached sketch allows you to display the data in decimal or hexadecimal and also displays it in text. There is a Boolean variable named hex early in the sketch. Use this to toggle the output.
If you have nothing in your EEPROM and you want to see how it is written to, then we also have the facility to add some test data.
There is a string named testData and this will contain whatever you want to put in your EEPROM.
Uncomment the line, storeToEeprom(); and upload the sketch.
The function that writes to the EEPROM is right at the bottom of the sketch named storeToEeprom() It is only two lines of code so should be easy enough to follow.
Comment the line out again and upload again.
The page header is created by the function displayHeader()
The first thing it does I loop through the entire EEPROM to see if there is any user data in any of the locations, and counts any bytes that are in use.
The rest of the function just sends the information the monitor.
The function getEepromData() does all the hard work, actually it doesn’t do much at all.
All this function does is loop through all of the bytes of data on the EEPROM one at a time and send it to the serial monitor in rows of eight at a time. At the end of the row it displays the text values.
Step 2: The End
This is only a short Arduino project and uses the absolute minimum parts for an Arduino project.
However it has inspired me to build something a little more sophisticated with bells, whistles and of course LEDs which I am sure will make an appearance sometime in the near future.
I hope that this may be useful to someone, somewhere, possibly, maybe???????????????????
Participated in the
Arduino Contest 2017