Electronic – DS1307-breakout-board

i2copen-drainpullupresistorsrtc

I want to build an RTC clock for the Raspberry Pi. Adafruit has a guide to accomplish this with Dallas DS1307. On the schematic they put a 2.2K resistor between VCC and SCL and do the same for VCC and SDA. SQLW is just wired out. But on the IC's datasheet, the resistors are proposed to be elsewhere:

Serial Data Input/Output. SDA is the data input/output for the I2C serial interface. The SDA pin is open drain and requires an external pullup resistor. The pullup voltage can be up to 5.5V regardless of the voltage on VCC.

Square Wave/Output Driver. When enabled, the SQWE bit set to 1, the SQW/OUT pin outputs one of four square-wave frequencies (1Hz, 4kHz, 8kHz, 32kHz). The SQW/OUT pin is open drain and requires an external pullup resistor. SQW/OUT operates with either VCC or VBAT applied. The pullup voltage can be up to 5.5V regardless of the voltage on VCC. If not used, this pin can be left floating.

So the question is: why there is a resistor at SCL and why there isn't any at SQW?

Best Answer

Seems like just a line omission from the datasheet. On the Pin Description section of Page 6

Pin 5- SDA:

Serial Data Input/Output. SDA is the data input/output for the I2C serial interface. The SDA pin is open drain and requires an external pullup resistor. The pullup voltage can be up to 5.5V regardless of the voltage on VCC.

Pin 6- SCL:

Serial Clock Input. SCL is the clock input for the I2C interface and is used to synchronize data movement on the serial interface. The pullup voltage can be up to 5.5V regardless of the voltage on VCC.

It seems to just skip a line stating that the pin is open drain and requires the external pull up, but then adds the same line afterwards, stating the pull up value. Looking at older versions of the datasheet, back when Maxim Integrated was Maxim-Dallas and even just Dallas Semi, the omission has always been there.

That said, the typical wiring diagram has always been correct, showing the pull up needed on both i2c lines, as the i2c standard requires.

As for the SQW/Out pin, the Pull Up is only required if you are using the line. It can be disabled in the rtc's settings (Or should I say, comes disabled, needs to be turned on). Having a pull up resistor on the line, when you are not going to use it, will waste energy, needlessly draining a battery (Slowly) in battery applications. As the datasheet says, this can be left floating, i.e. no pull up, if not needed. The Adafruit device breaks it out for your convenience if you do want to use it, but you need to add the pull up externally if you want to (or use the Arduino's internal pull-up option)

Related Topic