DS3231 Real Time Clock I2C Demo

Share on facebook
Share on twitter
Share on linkedin
Share on email
Share on print
Table of Contents

The DS3231 is a low-cost, precision I2C real-time clock (RTC) with an integrated temperature-compensated crystal oscillator (TCXO) and crystal. The Parallax DS3231 AT24C32 Real Time Clock Module includes a battery backup, and maintains accurate timekeeping when power to the module is interrupted. 

This device was demonstrated extensively in the JonnyMac Beginner Series for Spin2 and the video is linked under additional resources.

To set the time and date, change the highlighted lines of code in jm_ds3231_demo.spin2 and load to Flash. 

pub initialize_rtc()

'' Manually set RTC registers to current time and date

  rtc.set_time($30, $04, $15)                     ' 3:04:30 pm

  rtc.set_calendar($07, $23, $01, $21)            ' Saturday, 23 JAN 2021
Programming Language
Tools and Operating System
Document Author
Source Code Author
Table of Contents
0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Copyright © 2021 Parallax Inc. All Rights Reserved
Designed and Made in California, USA