I've wired up an ESP8266 (WeMos Mini) and have been making use of the module's "built in" EEPROM.
The docs are unclear on how this magic works, as there isn't an actual EEPROM chip anywhere, but I think it uses some the flash code space as "EEPROM" space.
However they do it, it works. Write to "EEPROM", remove power, data is retained.
Later, I added an DS3231 RTC with an actual 24C32 EEPROM (the cheap module found everywhere).
My question is, when I use EEPROM.read (or .write or .get or .put), which EEPROM am I writing to?
I'd LIKE to use both, as there's two versions of the project, one with RTC and one without. Both versions of the project store ESP8266 initialization data, but only the version with the RTC module stores RTC data.
alan-bc:
My question is, when I use EEPROM.read (or .write or .get or .put), which EEPROM am I writing to?
The pseudo-EEPROM of the ESP8266's flash memory.
alan-bc:
Is this possible? Can I use both? If so, how?
Yes.
Yes.
You can't use the EEPROM library to use the 24C32. Arduino libraries are available that provide an easy interface to this external EEPROM. Or you can write your own lower level code to do that same if you prefer.
If you using an esp8266 why are you using EEPROM? SPIFFS is a better solution.
There is something to be said for both, depending on the circumstances. Why would you store a file including it's path etc, for just a few bytes for instance ?
pert:
Or you can write your own lower level code to do that same if you prefer.
Thanks for the reply!
Sadly, I think this is what I'll have to do, as I can't find an I2C library as .. full featured .. as the stock EEPROM library.
I'm a new Arduino user, after being a long time (40+ years) assembly language programmer, for big chips and small. I'm used to writing my own libraries and I guess I've gotten spoiled with all these Arduino libraries.
In the old days .. aka, last year .. I often had to write the "tools" before writing the program. Now, I can get to work on the fun bits right away, which is kinda nice.