I keep seeing stuff about this: https://www.arduino.cc/reference/en/libraries/rtcvars/ when looking for storage for a few variables that survive turning off and on, but then it is only on ESP8266.
The thing I am trying to understand is what it has to do with the RTC.. Other RTCs don't seem to have this arbitrary storage ability. Is the RTC in an ESP8266 nothing like any other RTC? Or is this really just some other storage on the chip? And what is the storage technology itself? If I am using an arduino uno, or just at avr chip, is there any unit I can attach that is or isn't part of an RTC with the same storage properties? Or does every RTC have this ability, and just need somebody to write the library?
According to this https://forum.arduino.cc/t/save-data-in-nonvolatile-memory/140801/2, the RTC memory of the the ESP8266 can be written to an infinite number of times, whereas an SD card will wear out if you update a value on it every second (like for a counter).
What technology is this "RTC memory" using that I can attach to my avr project?
1 Answer 1
Some RTC chips contain a small amount of battery-backed SRAM ("NVRAM" - Non-Volatile RAM) which you can use for whatever you like. This is just ordinary RAM which is powered by the small battery that keeps the RTC running.
Not all do, though, so check the specs for your chosen RTC chip.
For example, the DS1302 has:
31 x 8 Battery-Backed General-Purpose RAM
That's 31 bytes of storage you can use for what you like.
Conversely the DS3231 doesn't have any spare RAM at all.
-
Thanks. "battery backed ram" - Now it all makes sense. I guess it's
SetMemory
in github.com/Makuna/Rtc/blob/master/src/RtcDS1302.hAlex028502– Alex0285022022年01月20日 12:15:15 +00:00Commented Jan 20, 2022 at 12:15 -
@Alex028502 Yep, and the associated
GetMemory
.Majenko– Majenko2022年01月20日 12:31:07 +00:00Commented Jan 20, 2022 at 12:31
>>> 4000000000 / 60 / 60 / 24 / 365
126.83916666666667
good point