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

RTC Calibration #8

Open
Gbouna opened this issue Sep 7, 2021 · 5 comments
Open

RTC Calibration #8

Gbouna opened this issue Sep 7, 2021 · 5 comments

Comments

@Gbouna
Copy link

Gbouna commented Sep 7, 2021

Thanks for the library, its been helpful for my application.

I am trying to use your library to get my RTC working with OpenMV Cam H7, I have read about the calibration of RTC which basically set the the RTC time and stores it in the battery-backed memory. So if a backup cell is used the RTC will run accurately in the event of a power outage.

I was wondering how do you I can set the RTC time and store it in the memory with your library. I will appreciate any suggestion on how to do this.
Thanks.

@shaoziyang
Copy link
Collaborator

Which chip do you use?

@Gbouna
Copy link
Author

Gbouna commented Sep 7, 2021

I am using OpenMV Camera H7.

What I just want to do is to be able to set the RTC time according to the current time and save it to the back up memory so that when there is power outage, the time will still be accurate since the RTC has a back up battery.

Any idea on how to do this will be appreciated

@shaoziyang
Copy link
Collaborator

Which RTC chip do you used with OpenMV Camera H7?

@Gbouna
Copy link
Author

Gbouna commented Sep 7, 2021

I am using DS3231

@shaoziyang
Copy link
Collaborator

shaoziyang commented Sep 7, 2021

DS3231 use registry 10h to calibration RTC (Aging Offset). I didn't implement the calibration function alone, but you can use setReg function to calibration RTC, such as:

ds = DS3231.DS3231(i2c)
ds.setReg(0x10, val)

image

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