Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With Battery, the device still doesn't seem to remember the set time #17

Open
truedat101 opened this issue Nov 16, 2023 · 3 comments
Open

Comments

@truedat101
Copy link

Subject of the issue

Using the coin cell battery. I ran the provided example code to first configure the time.

Set and Forget!
Once the RTC's time and date register have been set – using either the autoTime or setTime functions – you may never have to set the clock again! Consider commenting out the autoTime or setTime entirely once you've perfectly configured the clock.

Per the docs above, I have commented out the autoTime() call after setting it once. However, when I run, the clock is off.

Your workbench

  • What development board or microcontroller are you using? XIAO ESP32C3
  • What version of hardware or breakout board are you using? Not sure
  • How is the breakout board wired to your microcontroller? wired per diagram in hookup guide
  • How is everything being powered? USB power to board
  • Are there any additional details that may help us help you? N/A

Steps to reproduce

  1. Run the sample
  2. comment out rtc.autoTime()
  3. Re-run the code
  4. Note, the clock time has reverted to some earlier date/time.

Expected behavior

With the coin cell battery, the RTC time should be maintained.

Actual behavior

Time is not maintained. It resets to whatever time was used at compile time it would seem.

How to debug this problem? I tested the battery and the voltage is fine. Battery is inserted in correct orientation.

@truedat101 truedat101 changed the title With Battery, the device still doesn't seem to remember With Battery, the device still doesn't seem to remember the set time Nov 16, 2023
@PaulZC
Copy link

PaulZC commented Nov 16, 2023

Hi David (@truedat101 ),

The DeadOn is quite an old product. I suspect the board you have was made some time ago. Please check the battery negative pad on the circuit board, under the spring clip. If it is tarnished, try cleaning it with some rubbing alcohol (IPA) on a q-tip / swab. Or remove and reinsert the battery a few times to shift the tarnish.

I hope this helps,
Paul

@truedat101
Copy link
Author

Thanks, will try this. My board sat unused, so probably didn't develop any grime on the contacts. Is it correct to use rtc.autoTime() once, and then comment it out for the next run in the setup()?

@PaulZC
Copy link

PaulZC commented Nov 16, 2023

Yes, autoTime will set the RTC to the time the code was compiled. Compile, upload, then comment that line, wait a bit, compile and upload again. The RTC should keep running without being reset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants