RTC question

Bodger62

Member
I have downloaded the TimeTeensy3 example, compiled it and loaded it onto my Teensy 4.1, which has a 3v coin battery attached.

I then closed the IDE and opened the minicom display, which displays the time/date as I expected.

I changed the month and I can see that the date has changed as expected. I then disconnect the power to the board, on re-connecting I don't get the time and date that I expect. Below is the output that I see on the minicom display

16:24:41 26 7 2024
16:24:41 26 7 2024
16:24:41 26 6 2024
16:24:41 26 6 2024
16:24:42 26 6 2024
RTC has set the system time
0:00:01 1 1 2019
0:00:02 1 1 2019

I have checked the voltage of the cell and that seems okay. Can someone advise me what I'm doing wrong please.

I assume that I should see 26/06/2024 when I apply power to the board again, or am I mistaken?
 
A couple of questions:

- you say that you changed the month . . . how ??
- is your 3V coin battery attached to the GND & VBAT pins ??

Normally, to "save" the current time values to the RTC, a call to the Teensy3Clock.set(time_now); function should be made, followed by a call to the setTime(time_now); function, where timenow is defined as time_t time_now_hour;. The TimeTeensy3 example does make these calls when an updated time string is entered at the Serial Console.

Hope that helps . . .

Mark J Culross
KD5RXT
 
Thanks for your reply

I got the unix timestamp from the web and changed the month to June, put that in a file and then cut it.

When the program was running on the Teensy I opened minicom and pasted in the following

T 1718439814

which reset the time. However, when I turn the power off and then on again it hasn't retained that date, as shown in my previous post.

I am looking at the connections of the battery to the GND & VBAT pins now to see if that's what the problem is.
 
Back
Top