Why is there an EEPROM on RTC Modules? - Page 1
Forum section: electronics / beginners

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: March 22, 2017, 05:29:42 am
content: Hey all,Is the EEPROM (AT24C32) on cheap RTC modules used to store date/time values if the RTC loses power or is there some other purpose for this? Here's an example of one of these modules:http://www.dx.com/p/ds3231-high-precision-real-time-clock-module-blue-3-3-5-5v-222910

author: forrestc
author_rank: Unknown
timestamp: March 22, 2017, 05:55:48 am
content: I suspect it is to make data logging more convenient.Because the EEPROM can be written and erased on a per-byte basis, it makes since to log values to it until it is full, then you can copy it's contents to a SD card or wherever the data is going long term.There isn't any special between the EEPROM and the RTC that I can see or know of other than someone somewhere decided that having both on a little breakout board was a good idea.

author: helius
author_rank: Super Contributor
timestamp: March 22, 2017, 06:02:07 am
content: Time-Of-Day / Clock-Calendar chips for computers commonly include NVRAM, because both functions require battery backup and it is convenient to share a single battery. The design of clock modules with non-volatile storage (like EEPROM) may be based on that usage, especially if they use the same interface.

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 22, 2017, 06:05:33 am
content: A common use-case is for the application code to write the time into the NVRAM every few seconds or minutes (or whatever is appropriate). So that if the system loses power, the application can check the current time vs. the last recorded time-stamp to see how long it has been down and take appropriate action.

author: Ian.M
author_rank: Super Contributor
timestamp: March 22, 2017, 08:02:07 am
content: To a large extent its just crazy. I'm sure there are a few applications that can benefit from it, but if you log to EEPROM, with the AT24C32's 1M write page endurance, logging one byte per second, using the full memory (so the wear is even), you can wear it out in under seven weeks! Memory on a RTC module that's actually going to be used as a logging buffer needs to have unlimited write endurance (i.e, RAM or FRAM). You also want lots of it to minimise the number of writes to SD card or other FLASH.

author: Nusa
author_rank: Super Contributor
timestamp: March 22, 2017, 08:33:19 am
content: I think you're just looking at a two-fer module. You've got two I2C devices with different addresses on the same board. They're both slaves, so they can't talk to each other directly. It's up to the master to make use of them. Do an I2C port scan and see if they both show up.Using the magic of datasheets:DS3221 seems to have a fixed address of 0x68.AT24C32 has a configurable address of 0x50 - 0x58 (the A0,A1,A2 solder jumpers)

author: Thane of Cawdor
author_rank: Regular Contributor
timestamp: March 22, 2017, 09:10:23 am
content: Quote from: Richard Crowley on March 22, 2017, 06:05:33 amHmm I see, so by the 'system' you're referring to the microcontroller section only right (as in the RTC is still being powered by the CR2032 backup battery and thus timekeeping correctly)?

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 22, 2017, 04:19:47 pm
content: Quote from: Thane of Cawdor on March 22, 2017, 09:10:23 amYes. The complete larger system typically takes orders of magnitude more power to operate than can be provided by a small coin cell. So only the critical parts (real-time timekeeping, and certain variables) are stored in the NVRAM.

author: tecman
author_rank: Frequent Contributor
timestamp: March 22, 2017, 06:32:07 pm
content: Quote from: Richard Crowley on March 22, 2017, 06:05:33 amBe careful. EEPROMs have a finite number of write/erase cycles available. Writing every several seconds would result in a short life for the EEPROM. For the Atmel chip referenced, writing every 3 seconds would hit the life limit in 33 days. Typically EEPROMs are included on the same I2C bus as a convenience.paul

author: rstofer
author_rank: Super Contributor
timestamp: March 22, 2017, 07:45:43 pm
content: In the bad old days, program code was stored in EPROM (or OTP ROM) so there was no place to store things like calibration constants or any other field derived data. Wouldn't it be nice to have just a few bytes to store some things on a more or less permanent basis? Enter the RTC chip with a small slice of non-volatile memory (battery backed).Even modern uCs often have a small piece of EEPROM in addition to the fact that programs are stored in flash and data can be stored to flash under some conditions.https://electrosome.com/internal-eeprom-pic-microcontroller/Some uCs include code protection so the program can't write to flash memory after protection is enabled and the only place to store data is in the EEPROM. This is usually fairly small, on the order of 256 bytes or so.

author: Richard Crowley
author_rank: Super Contributor
timestamp: March 22, 2017, 08:30:44 pm
content: Quote from: tecman on March 22, 2017, 06:32:07 pmRight. Which is why the memory is battery-backed NVRAM, NOT EEPROM.