Module 3.4: Real Time Clock

Hi everyone, 

As you're aware, Module 3 has turned into a bit of a monster. To get all the information to you in a digestable format, we've broken it into six submodules which will each have their own page and discussion thread to manage questions that come up. Please use this thread to drop in all your questions about Module 3.4: Real Time Clock

Our new course directory will also help you navigate through all our the course content. 

Stay tuned for our updated module release schedule and plans for live events. Our events are going to take a different format going forward, likely picking up key discussions and challenges we're seeing pop up in the forum. We'll let you know more in coming days. 

Happy building! 

Steph 




Hi Jacinta & Akiba,

I have loaded the exercise "lab 3-4-4a, what time is it?", It compiles without problems and the time configured in the program appears when I open the serial monitor.
The problem is that if I disconnect the board, and reconnect it after a while, the time has not moved, it marks the same time
I have checked the 3V button battery and it is correct, also that the 3V reaches pins 4 and 8 of the Pcf8563
For some reason the clock does not tick, it seems that it has remained like us, frozen in a pandemic situation
Any ideas ?
Thank you !

Hi JAL.

For Module 3.4 - Lab 4a, the time will be hard coded into the sketch and then it will just print that time out. It's just to demonstrate how you would set it and how you would print it out. Every time you reset the board, the same time is reprogrammed into the real time clock so it will never advance. 

Where you will see the actual real time clock behavior is in Module 3.4 - Lab 4b where you set the clock from the command line and can read it from the command line. Since it won't be hard coded but rather set at run-time, and then independently read out, you should see the clock advance. Also you should only need to set the clock once as long as the backup battery holds up (should be good for a few months to years). 

Please try lab 4b and check if the clock can advance. You should see the seconds incrementing at least.

Akiba

Hi Akiba!
Now it's okay, and the clock is ticking!
Now I understand the errors I made, I had used the example of the Rtc_Pcf8563 "Setclock" library that contains in the Setup an "rtc.initclock" statement, with which every time you restart the program the clock starts counting from the starting point of departure.
Your first example did not set the clock either, and it only served to enter a time and print it later.
I had also tried to use the Rtc by Makuna library to automatically synchronize the time of the PC with that of the RTC, but I got a time loss error, as if, for some reason, the RTC did not retain the time. It is true that this library is designed for other RTC models of the DS **** series, and surely the error comes for that reason
Do you know if there is a library to fulfill this function with your RTC?
Thank you !!