DS3231 RTC: Difference between revisions

From Embedded Workshop
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:
  This 32Kbit (4096 x 8), will hold 4096 bytes of data.
  This 32Kbit (4096 x 8), will hold 4096 bytes of data.
   
   
  NOTE!  These modules typically have a battery charger circuit to recharge a lithium coin cell.
  '''NOTE!'''
        This can cause a problem is using non-rechargable coin cells.
  These modules typically have a battery charging circuit to recharge a LIR2032, lithium coin cell.
This can cause a problem if using CR2032, a cheaper non-rechargable coin cell.
This page describes the problem:
  https://forum.arduino.cc/t/ds3231-cr2032-vs-lir2032-warning-is-your-module-killing-the-battery/557346
  My preferred fix is to desolder the diode (or resistor), and lift one end from the board, thus
  breaking the charging circuit.  This method allows the circuit to be restored easily in the future.

Revision as of 16:00, 1 August 2024

The DS3231 RTC is a low cost, battery backup, Real Time Clock, that connects to an I2C bus, providing accurate time information.

Many DS3231 modules, like this one, https://www.ebay.com/itm/314250880191, have two I2C devices on-board,
a DS3231 RTC and a AT24C32 EEPROM, allowing the storage of information into non-volatile memory.

Documents:
DS3231: https://www.analog.com/media/en/technical-documentation/data-sheets/ds3231.pdf
The time (and temperature), are accessed via 19 byte-wide registers, see Address Map on page 11.

AT24C32: https://ww1.microchip.com/downloads/en/devicedoc/doc0336.pdf
This 32Kbit (4096 x 8), will hold 4096 bytes of data.

NOTE!
These modules typically have a battery charging circuit to recharge a LIR2032, lithium coin cell.
This can cause a problem if using CR2032, a cheaper non-rechargable coin cell.
This page describes the problem:
  https://forum.arduino.cc/t/ds3231-cr2032-vs-lir2032-warning-is-your-module-killing-the-battery/557346
  My preferred fix is to desolder the diode (or resistor), and lift one end from the board, thus
  breaking the charging circuit.  This method allows the circuit to be restored easily in the future.