I am not sure if anyone else has done anything with it but I have a need to save some data but I don't want to fool with the flash because you have to erase a whole sector to just save a couple of bytes of data, or least that is my read on it, unless someone knows a tricky way around that.
Anyhoo, I thought it might be interesting to throw a SuperCap on there and just see if that would work and sure nuf, the super cap charges up (slowly) and then when you power down the chip, it seems pretty stable.
So I wrote a little code to test out this theory (probably someone already tried this, but here it is
// ----------------------------------------------------------------------------
// Save something to RTC
// ----------------------------------------------------------------------------
static void savetoRTC(void)
{
bool ret;
uint32 rtc_addr = 64; // user memory
char str[32] = "Test1";
ret = system_rtc_mem_write(rtc_addr, str, strlen(str)/4+1);
if(ret) con_printf("data saved\r\n");
else con_printf("error\r\n");
}
// ----------------------------------------------------------------------------
// Get it back from RTC
// ----------------------------------------------------------------------------
static void getfromRTC(void)
{
bool ret;
uint32 rtc_addr = 64; // user memory (512 bytes)
char str[32];
ret = system_rtc_mem_read(rtc_addr, str, sizeof(str)/4);
if(ret) {
str[31] = 0; // precaution
con_printf("val: %s\r\n", str);
}
else {
con_printf("error\r\n");
}
Right now I have a .022F Cap on there (that is Farad not uf, if I am doing my arithmeestick right that is 22,000uf, but as Supercaps go I guess that is not all that big). Anyhow, it's been a couple of hours and it is still got my data saved. I am not sure if you have to put the chip into deep sleep, sleep or whatever, it doesn't seems like it. It seems like it is running just the RTC while the power is off.
Anybody else fooled with this ? I am gonna leave this one ESP8266 laying around for a coupla days and see what happens.