WaziRiPi
Posts: 92
Joined: Sun Nov 20, 2016 10:17 am

DS1307 Pi Zero

Sat Jun 19, 2021 3:10 pm

We add

/boot/config.txt

Code: Select all

dtoverlay=i2c-rtc,ds1307
and it does gives that kind of result.

We use this schematic: https://learn.adafruit.com/ds1307-real- ... /downloads

when we write i2cdetect -y 1 it gives different addresses.

Code: Select all

root@smartEQ:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- 25 -- -- 28 -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- 73 74 -- -- --                         
root@smartEQ:~# 
root@smartEQ:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- 31 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- 55 -- -- -- -- 5a -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@smartEQ:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- 0b -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- 32 -- -- 35 -- -- 38 -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@smartEQ:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- 0d -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- 53 -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@smartEQ:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- 13 -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- -- 
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: 60 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --     

After a while it stops giving any address.

WaziRiPi
Posts: 92
Joined: Sun Nov 20, 2016 10:17 am

Re: DS1307 Pi Zero

Sat Jun 19, 2021 4:17 pm

Is connecting GPIO2 and GPIO3 to SDA SCL with pull up resistor through 5V wrong?

trejan
Posts: 3317
Joined: Tue Jul 02, 2019 2:28 pm

Re: DS1307 Pi Zero

Sat Jun 19, 2021 4:21 pm

You've got a faulty RTC, bad soldering or bad wiring. My guess would be soldering or wiring.
WaziRiPi wrote:
Sat Jun 19, 2021 4:17 pm
Is connecting GPIO2 and GPIO3 to SDA SCL with pull up resistor through 5V wrong?
No. The Pi already has 3.3V pull ups resistors for SCL/SDA.

WaziRiPi
Posts: 92
Joined: Sun Nov 20, 2016 10:17 am

Re: DS1307 Pi Zero

Sat Jun 19, 2021 4:35 pm

We use this and Connect VCC to 5V. And SDA SCL to directly GPIO2 GPIO3. It does not recognize. RTC battery is also inserted.
adafruit_products_schem.png
adafruit_products_schem.png (6.04 KiB) Viewed 348 times

WaziRiPi
Posts: 92
Joined: Sun Nov 20, 2016 10:17 am

Re: DS1307 Pi Zero

Sat Jun 19, 2021 4:46 pm

Code: Select all

root@smartEQ:~# i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 
30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 
60: 60 61 62 63 64 65 66 67 UU 69 6a 6b 6c 6d 6e 6f 
70: 70 71 72 73 74 75 76 77
Now, I2C is detected but why all address are exist?
I changed crystal and it appeared.

trejan
Posts: 3317
Joined: Tue Jul 02, 2019 2:28 pm

Re: DS1307 Pi Zero

Sat Jun 19, 2021 5:03 pm

WaziRiPi wrote:
Sat Jun 19, 2021 4:46 pm
Now, I2C is detected but why all address are exist?
SDA is shorted to ground.

User avatar
rpdom
Posts: 18867
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: DS1307 Pi Zero

Sat Jun 19, 2021 6:51 pm

WaziRiPi wrote:
Sat Jun 19, 2021 4:17 pm
Is connecting GPIO2 and GPIO3 to SDA SCL with pull up resistor through 5V wrong?
You should not connect SDA or SCl to 5V through a resistor. There are already resistors on the Pi to pull up to 3.3V. 5V is too high for the Pi and could cause damage.
Unreadable squiggle

WaziRiPi
Posts: 92
Joined: Sun Nov 20, 2016 10:17 am

Re: DS1307 Pi Zero

Sat Jun 19, 2021 7:35 pm

rpdom wrote:
Sat Jun 19, 2021 6:51 pm
WaziRiPi wrote:
Sat Jun 19, 2021 4:17 pm
Is connecting GPIO2 and GPIO3 to SDA SCL with pull up resistor through 5V wrong?
You should not connect SDA or SCl to 5V through a resistor. There are already resistors on the Pi to pull up to 3.3V. 5V is too high for the Pi and could cause damage.
So you mean even if I remove resistors DS1307 will work. I am asking to know what it should do theoretically.

User avatar
rpdom
Posts: 18867
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: DS1307 Pi Zero

Sat Jun 19, 2021 7:48 pm

WaziRiPi wrote:
Sat Jun 19, 2021 7:35 pm
So you mean even if I remove resistors DS1307 will work. I am asking to know what it should do theoretically.
Yes, you don't need any extra resistors. The Pi already has them.
Unreadable squiggle

WaziRiPi
Posts: 92
Joined: Sun Nov 20, 2016 10:17 am

Re: DS1307 Pi Zero

Sun Jun 20, 2021 4:53 pm

Thank you for your supports.

Return to “Interfacing (DSI, CSI, I2C, etc.)”