DS1302 Timekeeping Chip Maxim Integrated | DigiKeyDS1302 TrickleCharge Timekeeping ChipRTCDS1302 Module WikiLibrary example: DS1302 : DS1302LCDInterfacing a DS1302 With an 8051Type Mi | Maxim IntegratedInterfacing a DS1302 With an 8051Type RTCDS1302/DS1302.cpp at main · mirgame/RTCDS1302 · maxim / dallas DS1302 RTC GPIO bitbanging driver. · GitHub
You can use the DS1302 for mbed boards with no RTC, or boards like the KL25Z which do have an RTC, but no proper battery connection to keep it running when the board is unpowered. The DS1302 also contains 31-bytes of RAM which remain valid as long as there is battery power. The IC supports trickle charging of a battery, but the library does not implement this, and neither do the standard available breakout boards: since it should run virtually forever on a CR2032 this is generally not a problem.
The DS1302 is easy to add to your project, there are breakout boards available, but a coin cell holder and a 32kHz crystal are all you need to connect it besides the DS1302 (DIP available) itself. There are better ICs, with integrated crystals, but the DS1302 is cheap :).
The library for this component calculates the internally used BCD fields to a UNIX time stamp, which the standard C functions and the mbed lib also use. If you prefer to directly use the values stored in the IC (which will be a bit faster), there is the following library, however some functions are lacking or not properly implemented:Import libraryds1302
Real Time Clock ds1302 library
Last commit 03 Dec 2010 by Gerardo Cibeira