-
Notifications
You must be signed in to change notification settings - Fork 9
adafruit_ds1307 module does not respect user-changed values for Square Wave output #24
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
Conversation
The existing code relied on checking the values of the square wave register, and confirming that the default of 0x#3 was set. These values are user selectable and should not be used to validate the device is an DS1307. I followed the same logic, but applied it to the fields that are guaranteed to always be 0 in the DS1307 manual, instead of using user-changeable values.
Updated adafruit_ds1307.py to allow Square Wave settings
@caternuson any thoughts? |
This seems OK. But a little curious how one runs into this. @coplate Are you restarting your code without a power cycle? Wondering how the check gets back anything from the register other than the expected power on defaults? |
@caternuson |
Updating https://github.com/adafruit/Adafruit_CircuitPython_BH1750 to 1.1.0 from 1.0.7: > Merge pull request adafruit/Adafruit_CircuitPython_BH1750#6 from DeadSix27/main > Patch .pre-commit-config.yaml > change discord badge > Patch: Replaced discord badge image > Updated gitignore > Update Black to latest. > Fixed readthedocs build > Consolidate Documentation sections of README Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 5.2.1 from 5.2.0: > Merge pull request adafruit/Adafruit_CircuitPython_CircuitPlayground#117 from Neradoc/frozen-module-subdirectory Updating https://github.com/adafruit/Adafruit_CircuitPython_DS1307 to 2.1.10 from 2.1.9: > Merge pull request adafruit/Adafruit_CircuitPython_DS1307#24 from coplate/main > Patch .pre-commit-config.yaml > change discord badge > Patch: Replaced discord badge image > Updated gitignore > Update Black to latest. > Fixed readthedocs build > Consolidate Documentation sections of README Updating https://github.com/adafruit/Adafruit_CircuitPython_UC8151D to 1.1.0 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_UC8151D#4 from HDR/main > Patch .pre-commit-config.yaml > change discord badge > Patch: Replaced discord badge image > Updated gitignore > Update Black to latest. > Fixed readthedocs build > Post-patch cleanup > Consolidate Documentation sections of README Updating https://github.com/adafruit/Adafruit_CircuitPython_BitmapSaver to 1.2.1 from 1.2.0: > Merge pull request adafruit/Adafruit_CircuitPython_BitmapSaver#23 from matt-land/add-typing > Patch .pre-commit-config.yaml
I am working on a project with my rp2040 where I am using my DS1307 to trigger an interrupt every 1 second.
I had started this project in MicroPython with another library, and had updated register 07 in the DS1307 with the flags to generate a 1Hz square wave. ( set bits in register to '00010000' ).
When I started updating my project to use CircuitPython, I imported this library and found that it used those bits to validate if it is a 1307, which will not work.
This pull request is to update the module to reflect the specifications provided by the manufacture for which fields are constant.