Skip to content

ValueError: Unable to find DS1307 at i2c address 0x68. #10

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

Closed
soneups opened this issue Mar 2, 2019 · 4 comments
Closed

ValueError: Unable to find DS1307 at i2c address 0x68. #10

soneups opened this issue Mar 2, 2019 · 4 comments

Comments

@soneups
Copy link

soneups commented Mar 2, 2019

if i 'i2c.scan()' i can see the ds1307 at 0x68 however the last command to setup the rtc fails with an unable to find DS1307 at i2c address ox68 - any help or points greatly appreciated!

Adafruit CircuitPython 3.1.2 on 2019-01-07; Adafruit ItsyBitsy M4 Express with samd51g19

import busio
import adafruit_ds1307
import time
from board import *
myI2C = busio.I2C(SCL, SDA)
rtc = adafruit_ds1307.DS1307(myI2C)
Traceback (most recent call last):
File "", line 1, in
File "adafruit_ds1307.py", line 85, in init
ValueError: Unable to find DS1307 at i2c address 0x68.

@soneups
Copy link
Author

soneups commented Mar 2, 2019

Self resolving.

@soneups soneups closed this as completed Mar 2, 2019
@Snudi
Copy link

Snudi commented Dec 2, 2021

@soneups : How did you solve it? im getting the same error with my RP2040 Board (Pimoroni Plasma Board) and a Sparkfun DS1307 Module. The Device Address is fine (0x68) and the SDA/SCL Pulled up but with the Adafruit DS1307 Library im getting the "ValueError: Unable to find DS1307 at i2c address 0x68." Error
Thanks a lot, Ruediger

@Snudi
Copy link

Snudi commented Dec 3, 2021

I solved it by Myself. In the Original .py File was a section to verify the correct RTC Board.
`# Try and verify this is the RTC we expect by checking the rate select
# control bits which are 1 on reset and shouldn't ever be changed.
buf = bytearray(2)
buf[0] = 0x07
with self.i2c_device as i2c:
i2c.write_then_readinto(buf, buf, out_end=1, in_start=1)

    if (buf[1] & 0b00000011) != 0b00000011:
        raise ValueError("Unable to find DS1307 at i2c address 0x68.")`

I removed it completly because i know it is the right board. Then i created a new DS1307 Library without this code. I append it on my comment. Now it works fine. Hope i could help someone with it in the Future. Best Ruediger

adafruit_ds1307.zip
.

@coplate
Copy link
Contributor

coplate commented May 20, 2022

I have submitted a Pull request for this issue, as the existing validation mentioned does not reflect the manufacturers documentation. Those 2 bits are intended to be alterable, not fixed.
#24

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

3 participants