Date and Time lost with Teensy 4.1

Videophile

New member
This is my first post here! :)

I don't know if newcomers need to presents themselves here, but just in case: I have already done several projects with Arduino and a few with Teensy boards, so I would qualify me as an "advanced hobbyist". Usually, when I have a problem, I find the solution in the technical documentation or in forums. But in this case, I am running out of ideas...

So here is my problem: I use a Teensy 4.1, I have connected a coin battery to VBAT, the voltage is correct (2,99V), but still, the date and time revert to 01/01/1970 00:00 each time I switch off the Teensy. The Teensy is powered through USB for now. I use the setTime function to set the date and time, and I get the current date and time using the year(), month(), etc. functions. I use the Arduino 2.0 IDE.

What am I doing wrong ?
 
Welcome to the forum!
You may have missed the Forum Rule at the top of this page: "Always post complete source code & details to reproduce any issue!"

It helps a lot when you post your code so that other forum members can just copy and paste the code into their Arduino IDE and try to reproduce [and help solve] the problem. Photo's of your setup will also help.

Please use code tags by clicking the # sign when posting code:

codetags.png

Paul
 
@PaulS: sorry for not respecting the forum rules, I will post my code next time. As usual, I didn't read the manual, but this is no excuse :rolleyes:. However, for this issue, it won't be needed, because...

...@PaulStoffregen: spot on, thanks a lot for your help!
 
Back
Top