Hardware Reference
In-Depth Information
Power
If you've looked at the datasheet for the DS1307 before, you might be wondering about
the power supply voltage. The datasheet lists it as a +5 V part, and by now you are well
aware that the Pi's GPIO pins operate at +3 V levels. The DC operating conditions are
summarized here:
Parameter
Symbol
Min
Typ
Max
Units
Supply voltage
V CC
4.5
5.0
5.5
Volts
Battery voltage
V BAT
2.0
3.5
Volts
It is tempting to consider that the PCB might operate at +3.3 V, given that the battery
in the unit is 3 V. However, that will not work because the DS1307 chip considers a V CC
lower than 1.25 × V BAT = 3.75 V to be a power-fail condition (for a typical operation). When
it senses a power fail, it relies on battery operation and will cease to communicate by I2C,
among other things. Power-fail conditions are summarized here:
Parameter
Symbol
Min
Typ
Max
Units
Power-fail voltage
V PF
1.26× V BAT
1.25× V BAT
1.284× V BAT
Volts
The note in the datasheet indicates that the preceding figures were measured when
V BAT = 3 V. So these figures will likely deviate when the battery nears expiry. Given the
power-fail conditions, we know that the device must be powered from a +5 V power
supply. But the only connections made to the Raspberry Pi are the SDA and SCL I2C lines.
So let's take a little closer look at those and see if we can use them.
3-Volt Compatibility
The SCL line is always driven by the master, as far as the DS1307 is concerned. This
means that SCL is always seen as an input signal by the RTC clock chip. All we have to
check here is whether the Raspberry Pi will meet the input-level requirements. Likewise,
the AT24C32 EEPROM's SCL pin is also an input only.
The SDA line is driven by both the master (Pi) and the DS1307 chip (slave). The SDA
is driven from the Pi as a 3 V signal, so again we need to make certain that the DS1307 will
accept those levels. But what about the DS1307 driving the SDA line? The Pi must not
see +5 V signals.
The DS1307 datasheet clearly states that “the SDA pin is open drain, which requires an
external pull-up resistor.” The Raspberry Pi already supplies the pull-up resistor to +3.3 V.
This means that the DS1307's open drain will allow the line to be pulled up to +3.3 V for
the high logic level, when the output transistor is in the off state. When the transistor is
on, it simply pulls the SDA line down to ground potential. Thus with
open-drain operation, we can interoperate with the Raspberry Pi. A check of the AT24C32
EEPROM datasheets leads to the same conclusion.
 
 
Search WWH ::




Custom Search