I am trying to make my DS1307 work with my binary clock setup. I was successful to set the time and read it, but I can't get the SQW pin to produce a 1Hz output, it seems it is always high.
I tried many libs, but Adafruit's RTClib seems to be the easiest to test. I set the SQW to 1Hz, it reads it's state as 1Hz, but when I connect to led to test it's either always on (when I connect the anode via 1k resistor to sqw output) or always off (when I connect the cathode to sqw and anode to 5v via 1k resistor). The sqw is connected to 5V via 10k pullup resistor. Any other ideas what might be wrong?
If you want to drive a LED
- After a quick look I don't see the max current but they suggest 5mA should be possible. I would not go beyond this
- The output is open drain. Aka, led(+resistor) between Vcc (anode) and the pin (cathode). No pull up.
- SQW can also be disabled. bit4 of 07h should be 1, to enable the square wave output. Adafruit's RTClib can set this with .Ds1307SqwPinMode() method.
Ok, I solved the problem... And I feel so dumb.
I thought I order DS1307, but I actually order DS3231 and that's why it was not working.
So I guess this thread may be deleted or closed.
The DS3231 SQW output works, but if you have the typical eBay board, it should be modified as described here.