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

DS1307 and HALT method #4

Open
michalowskil opened this issue Jan 17, 2023 · 1 comment
Open

DS1307 and HALT method #4

michalowskil opened this issue Jan 17, 2023 · 1 comment

Comments

@michalowskil
Copy link

michalowskil commented Jan 17, 2023

Not sure is it a bug or not. When I disconnect and then connect battery DS1307 is resetting to (2000, 1, 1, 0, 0, 0, 0, 0) which is fine, but it is not ticking. When I run ds.halt() it returns FALSE. Clock start ticking when I manually set FALSE like this: ds.halt(False).

Shouldn't ds.halt() return TRUE when clock is halted?

I'm not using a module. I just connect DS1307 with oscillator and resistors like this:
scheme

@mcauser
Copy link
Owner

mcauser commented Jan 18, 2023

Needs further investigation. I don't have one of these modules handy for the next few weeks.

Expected behaviour:
ds.halt() - return the current value (self._halt), without reading the register
ds.halt(True) - read the DATETIME_REG register, set bit 7 = 1, write back to the register
ds.halt(False) - read the DATETIME_REG register, set bit 7 = 0, write back to the register

If the default halt bit 7 value in the register is True, I should update the constructor to set self._halt = True, or perhaps just make the halt() method always read the register and not try to cache it.

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