DS1307 "two wire bus" compatible with 3.3V beaglebone I2C bus?

Hi,

I looked through the datasheet of the DS1307 RTC clock. The datasheet
carefully prevents mentioning the word "I2C" and I dont find any
definitive iniformation whether this "two wore bus" is compatible
with a 3.3V I2C bus as that one on the Beaglebone....

Does anyone out there has successfully used the DS1307 RTC chip
in conjunction with the Beaglbone using its native I2C bus (no bit
banging :wink: ) ???

Thank you very much for any information regarding the usage of this
chip.

Best regards,
mcc

I’ve successfully used the DS1338, which has the same functionality as the DS1307 but operates at 3.3V instead of 5V. I also had to enable the DS1307/DS1338 support in my kernel config, but it seems to be working just fine with the normal Linux “hwclock” commands in Angstrom.

Hi Mike,

THANKS A LOT! :slight_smile:

Good news!
Do you use the bare chip (self soldered) or a breakout board?
Do I have to care of diferent "versions" (like voltage, freqs et
cetera) when using a RTC on the SPI bus instead of one for the I2C?

Best regards,
mcc

Mike Borden <mborden1@gmail.com> [12-10-24 16:56]:

I've successfully used the DS1338, which has the same functionality
as the DS1307 but operates at 3.3V instead of 5V. I also had to
enable the DS1307/DS1338 support in my kernel config, but it seems to
be working just fine with the normal Linux "hwclock" commands in
Angstrom.

As a "me too":
I run the DS1339C-33# (3.3V signaling and power with internal crystal)
on my bone without issue.

Yeah, just the “bare chip”, though the DS1338 requires an external oscillator. If you want, you can buy this board:

https://www.sparkfun.com/products/99

And replace the DS1307 with the DS1338. That only really saves you buying the oscillator though. Andrew’s response of using the DS1339 will probably save you that effort.

Hi *,

looks like this becomes a RTC-party... :wink:

In the meanhwile I found this one

    https://www.sparkfun.com/products/10160
    http://www.watterott.com/de/DeadOn-RTC-DS3234-Breakout

. It is attached to SPI instead of I2C. Unfortunatley the
BeagleboneSRM does not tell me that much about SPI.
I think the high precision of this clock and the additional
temperature measuring makes this one also an interesting item.

Will it work on the SPI of the beaglebone or do I need additional
power eating parts.... ???

Best regards,
mcc

Mike Borden <mborden1@gmail.com> [12-10-24 17:48]:

Well, I can’t really say from experience, but the kernel config looks like it natively supports the DS3234 over SPI if you recompile the kernel with that option configured. I’m not sure what your criteria is for selecting that part over the other, but why not give it a whirl and let us know how it goes?

The only things which prevents me from doing so is the fear to fry
parts of of the whole beaglebone by combining things which
electrically dont fit...

Mike Borden <mborden1@gmail.com> [12-10-24 18:08]:

Hi,

The SPI-based device you found will work fine at 3.3V, so there is no risk of frying your Beaglebone. Just be sure to connect the VCC pin on the RTC’s breakout board to 3.3V on your Beaglebone.

By the way, it might be possible to connect your I2C-based DS1307 to the Beaglebone. But, you have to be very sure that the I2C pin’s pull-ups are to 3.3V, not 5V. See this page for instructions http://learn.adafruit.com/adding-a-real-time-clock-to-raspberry-pi/wiring-the-rtc. It refers to the Raspberry Pi, which like the Beaglebone supports 3.3V on the I2C pins, and would be fried by 5V.

Another approach to connecting 5V I2C devices to the Beaglebone is to use a level converter, like this: https://www.sparkfun.com/products/8745.

Dan.

Hi Dan,

thanks a lot for the informations! That helps!

I think I will order one of the clocks the next days and
when it is up and running (or I finally have failed) I will report
back here...

Best regards,
mcc

Dan Watts <gigamegawatts@gmail.com> [12-10-24 19:28]:

There’s no such thing as failure, only “integration” and “debugging”! Looking forward to hearing about your progress.

Hello Andrew,

I was reading about RTC for Bone and stumbled across this. Do you have a wiring diagram for the DS1339 and the bone, and any steps on the software side of the config ?

Regards

Cyril

I wired the DS1339 to I2C2 on the bone, same as the EEPROMs on capes.
The addresses won't conflict. Power came from VDD_3V3EXP. You don't
_need_ pullups on the DS1339 if you have a cape attached, but it's
recommended to use the values from the SRM for I2C devices.

Changes required to support from the kernel include modifying the
board-file to add the DS1339 platform info and then making sure
i2c2_init() gets called. Something like:

static struct i2c_board_info am335x_i2c2_boardinfo[] = {
        {
                I2C_BOARD_INFO("rtc-ds1339", 0x68),
                .type = "ds1339",
        },
};
static void i2c2_init(int evm_id, int profile)
{
        setup_pin_mux(i2c2_pin_mux);
        omap_register_i2c_bus(3, 100, am335x_i2c2_boardinfo,
                        ARRAY_SIZE(am335x_i2c2_boardinfo));
        return;
}

-Andrew

Thanks a lot Andrew for you quick reply. I will try this out. Is a breakout board available for DS1339 ? I checked Adafruit and Sparkfun, they only have DS3234, DS1307 & DS3231.

Regards

Cyril

Thanks a lot Andrew for you quick reply. I will try this out. Is a
breakout board available for DS1339 ? I checked Adafruit and
Sparkfun, they only have DS3234, DS1307 & DS3231.

Not that I know of. You can buy wide SOIC perf board from Digikey[1] or
similar for about $20 which should work well. The main issue with the
DS1339C version is that a lot of the pins all need to be tied to
ground and doing the pullups, it's easy on the perf board, but a bit
hard without (although it is doable if you're patient).

[1]:8100-SMT4 Twin Industries | Prototyping, Fabrication Products | DigiKey

A prebuilt module would be nice... Maybe I'll make one some day...

Thanks Andrew,
mean while I got a DS1307 (adafruit breakout) working on the Bone. Thanks for your help.

Regards

Cyril