0

DS3231 RTC breakout suggestion
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

DS3231 RTC breakout suggestion

by rajib_gupta on Fri May 04, 2018 2:49 pm

Hi all,

DS3231 RTC datasheet clearly mentions that all N.C(Not connected) pins must be connected to ground.

Although Adafruit DS3231 precision RTC breakout has left them open. Is there any specific reason for that ?

What is the correct way ?
Attachments
ds3231 datasheet capture.PNG
ds3231 datasheet capture.PNG (158.93 KiB) Viewed 179 times

rajib_gupta
 
Posts: 1
Joined: Fri May 04, 2018 2:45 pm

Re: DS3231 RTC breakout suggestion

by pierrot10 on Sun May 20, 2018 2:20 pm

An suggetsion? It's interresting to know?

On other hand, Ihave pain to understand the use of
Code: Select all | TOGGLE FULL SIZE
rtc.lostPower()
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));


Some can explain what does rtc.lostPower()

In the exemple file, that function is at startup(). So it make sense that when startup() is call is because we lunch or module, the the power has been lost.
Excepted if we reset the module. In that case, I suppose rtc.lostPower return false?

My concern is to adjust the time.
What's the difference between
Code: Select all | TOGGLE FULL SIZE
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));


I understand that the second, adjust the time and we should call it only once, excepted if we remove the cell battery.

But what does the first with __DATE__ and __TIME__??

While we set the time with
Code: Select all | TOGGLE FULL SIZE
rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));

does the time is store in __DATE__ and __TIME__ and next time I lunch my module, the time is set with __DATE__ and __TIME__

In my setup() I have this
Code: Select all | TOGGLE FULL SIZE
#if defined(SENSOR_RTC_DS3231)
      if (! rtc.begin()) {
        Serial.println("Couldn't find RTC");
        while (1);
      }
     
      if (rtc.lostPower()) {
        Si.sprintln(F("RTC lost power, lets set the time!"),2);
        rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
        #ifdef RTC_CALIBRATE   
          Si.sprintln(F("Calibrating the RTS DS3231"),2);
          rtc.adjust(DateTime(2018, 5, 20, 19, 27, 0));
        #endif
      }
    #endif


but I can not make sure that this above code is perfect as I do not understand well the 3 function... :)

I want to be able to define RTC_CALIBRATE, when I want to correct or set a new time. Otherwise, it should alway use the date and time record du to the cell battery.

Thank a lot for your clarification

pierrot10
 
Posts: 258
Joined: Tue Nov 17, 2015 4:34 pm

Please be positive and constructive with your questions and comments.