Hardware Reference
In-Depth Information
Logic Levels
How do the I2C logic levels compare between the Raspberry Pi and the DS1307?
Signal
Raspberry Pi
DS1307
V IL
£ 0.8 volts
£ 0.8 volts
V IH
³ 1.3 volts
³ 2.2 volts
The V IL figure matches perfectly for both sides. As long as the Raspberry Pi provides
a high level exceeding 2.2 V, the DS1307 chip should read high levels just fine. Given
that the Pi's pull-up resistor is connected to +3.3 V, there is very little reason to doubt
problems meeting the DS1307 V IH requirement.
To summarize, we can safely power the DS1307 from +5 V, while communicating
between it and the Raspberry Pi at +3 V levels. The Pi already supplies pull-up resistors
for the SCL and SDA lines, and these are attached to +3.3 V. If, however, you choose to use
other GPIO pins to bit-bang I2C (say), you'll need to provide these pull-up resistors (they
must go to only +3.3 V).
Tiny RTC Modifications
In the preceding section, you saw that even though the DS1307 is a +5 V part, the SDA
pin is driven by an open-drain transistor. With the Raspberry Pi tying the SDA line to +3.3
V, the highest voltage seen will be exactly that. The open-drain transistor can only pull
it down to ground (this also applies to the AT24C32 EEPROM). Both chips have the SCL
pins as inputs (only), which are not pulled high by the chips themselves.
If you purchased a PCB like the one I used, however, be suspicious of pull-up
resistors! I knew that the parts would support +3.3 V I2C bus operation before the PCB
arrived in the mail. However, I was suspicious of added pull-up resistors. So when the
PCB arrived, I quickly determined that the PCB did indeed include pull-up resistors
connected to the +5 V supply. The extra +5 V pull-up resistors must be tracked down and
removed for use with the Raspberry Pi.
Checking for Pull-up Resistors
There are two methods to test for pull-up resistors: a DMM resistance check and a voltage
reading. I recommend that you apply them both.
Since this modification is important to get correct, the following sections will walk
you through the two different procedures in detail.
 
 
Search WWH ::




Custom Search