As part of the Winter Logger project, I got myself some DIP EEPROMs from eBay which were ostensibly AT24C256’s, mostly because I didn’t feel like buying yet more stuff that I probably would never use just to pad out Mouser’s £33 for free shipping minimum order.
This is what I got: Suspicious…
With all the counterfeit semiconductors floating out there, I wanted to verify if I at least had functional EEPROM that wasn’t literally just plastic with some legs tacked onto it - I wanted to test if all the memory cells actually worked....
Early on in the conceptualization phase of this project, I wanted something that had good customisability on board. That meant that I would need some sort of non-volatile memory to store all user changeable parameters, so I wouldn’t have to set everything up all over again every time I unplugged the thing. Out of all possible solutions, EEPROM would probably be the easiest to implement.
The STM32F103 does not have internal EEPROM (unlike some AVR micros) however, and I really didn’t want to go to all the trouble to decipher ST’s emulated EEPROM library....
First off, there are already a whole bunch of tutorials on how to use this particular I2C EEPROM with an Arduino. If you want to understand how such an EEPROM works, this post is not for you.
I just wanted to share this bit of code with anyone who doesn’t feel like writing their own. It basically allows you to select an EEPROM address and specify a payload to be written to that particular address....