Hardware Reference
In-Depth Information
If you've done this correctly, you will have identified the two resistors that need to be
removed. If you plan to interface the SQW/OUT pin to a Pi GPIO, you'll want to remove
the pull-up used on that as well.
DS1307 Bus Speed
The DS1307 datasheet lists the maximum SCL clock speed at 100 kHz:
Parameter
Symbol
Min
Typ
Max
Units
SCL clock frequency
f SCL
0
100
kHz
The Raspberry Pi uses 100 kHz for its I2C clock frequency (see Chapter 12 of
Raspberry Pi Hardware Reference [Apress, 2014] for more information). The specification
also states that there is no minimum frequency. If you wanted to reserve the provided I2C
bus for use with other peripherals (perhaps at a higher frequency), you could bit-bang
interactions with the DS1307 by using another pair of GPIO pins. (Pull-up resistors to
+3.3 V will be required; the internal pull-up resistors are not adequate.) That is an exercise
left for you.
Now that we have met power, signaling, and clock-rate requirements, “Let's light this
candle!”
RTC and RAM Address Map
The DS1307 has 56 bytes of RAM in addition to the real-time clock registers. I/O with
this chip includes an implied address register, which ranges in value from 0x00 to 0x3F.
The address register will wrap around to zero after reaching the end (don't confuse the
register address with the I2C peripheral address).
Note
the DS1307 rtC uses i2C address 0x68.
The address map of the device is illustrated in Table 4-1 . The date and time
components are BCD encoded. In the table, 10s represents the tens digit, while
1s represents the ones digit.
 
 
Search WWH ::




Custom Search