Volatile RAM. Thinking DS1307 without battery.


Author Message
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2122
Posted: 09:18pm 21 Jan 2025      

  twofingers said  The DS3231 RTC chip has 7 bytes that are actually intended for alarms. These could be used to remember states beyond power off.


this is a great tip!

one caveat, the registers store BCD and are not fully 8 bits (bit 7 of each register means something) so you need to be attentive that any values written conform. I have just tried here writing &h7F, and it got munged into some weird value I have yet to interpret. Mine come from 99p modules off ebay so are probably chinese knock-offs so ymmv.

Stick to a few flags in the bottom couple of bits and you should be fine.
Edited 2025-01-22 07:23 by CaptainBoing