Shop OBEX P1 Docs P2 Docs Learn Events
DS1307 RTC via I2C to the Propeller, dealing with a 5 volt signal — Parallax Forums

DS1307 RTC via I2C to the Propeller, dealing with a 5 volt signal

ElectricAyeElectricAye Posts: 4,561
edited 2008-09-04 13:21 in Propeller 1
Hi all,
I'm planning on using a DS1307 real time clock with my Propeller and I have pored over the following thread:

http://forums.parallax.com/forums/default.aspx?f=25&p=1&m=124837

Contained within that thread are the thoughts and feelings and sentiments and guesses of many people concerning interfacing 5 volts to the Propeller. The conclusion I've come to is that I should be able to use 10K resistors for pullups and 1K resistors in series to cut down on too much current. Submitted for your approval: one schematic. In lieu of approval, I'd appreciate comments, suggestions, even outright ridicule if it will prevent me from smoking my chips. Will this work?



many thanks,
Mark smile.gif
1900 x 1428 - 591K

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-03 22:09
    EA,

    I don’t have any advice on your connection…at least nothing that hasn’t already been covered in the linked thread. I do have a question though. Why not just use the DS1302? It is in the same class as the DS1307, has similar features and runs from 3.3V.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • HarleyHarley Posts: 997
    edited 2008-09-03 22:09
    Mark said...
    Hi all,
    I'm planning on using a DS1307 real time clock with my Propeller and I have pored over the following thread:

    http://forums.parallax.com/forums/default.aspx?f=25&p=1&m=124837

    Contained within that thread are the thoughts and feelings and sentiments and guesses of many people concerning interfacing 5 volts to the Propeller. The conclusion I've come to is that I should be able to use 10K resistors for pullups and 1K resistors in series to cut down on too much current. Submitted for your approval: one schematic. In lieu of approval, I'd appreciate comments, suggestions, even outright ridicule if it will prevent me from smoking my chips. Will this work?

    My preference would be to have the 10K resistors only on lines which are open-collector or tri-state ouputs (from the DS1307). The series resistors are only required when a 5v device is driving the Prop; then you want to limit the current into the Prop if it is pulled above the 3.3v level.

    The two resistors, the way you show them, provides a voltage divider of 1/11th for the Prop driving a device. This will reduce the signal to the device; in some cases may pose a problem. Just something to keep in mind.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-03 22:50
    Chris,
    I guess I picked the DS1307 instead of the DS1302 because I'm clueless.· I saw the object for the DS1307 on the Obex and just blindly assumed there would be no hair-pulling issues.· It wasn't until today, just as I was wiring up the DS1307,·that I noticed the need for 5 volts and saw the potential for problems.· Only then did I freak.·
  • RaymanRayman Posts: 14,360
    edited 2008-09-03 23:24
    I think the main reason to use the DS1307 is that you can connect it to the existing I2C pins on the Prop and thereby not use any free pins. No·extra pullup resistors are needed if you do it this way.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-04 00:13
    Thanks Rayman,
    I think you're correct: I was worried about running out of pins so I wanted to use the DS1307 because it can be called by an address on a single I2C set of lines.

    Marksmile.gif

    Post Edited (ElectricAye) : 9/4/2008 1:30:45 AM GMT
  • RaymanRayman Posts: 14,360
    edited 2008-09-04 01:23
    It's the ones going to the EEPROM (Pins 28&29)...

    http://www.rayslogic.com/propeller/ProtoSched.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-09-04 01:26
    I believe there are 3.3V parts that are I2C as well though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-04 01:36
    Thanks, guys,
    I need to look into this 3.3volt I2C more closely.· I bet they only come in SOICs or something.· In the meantime I'll see how - or if - I can get my present DS1307 to work without fireworks.

    wish me luck,
    Mark
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-04 01:40
    The ds3231 is I2c 3.3V but as you said is SOIC.
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-04 01:46
    Rayman said...
    It's the ones going to the EEPROM (Pins 28&29)...

    http://www.rayslogic.com/propeller/ProtoSched.gif
    Hey Rayman,
    I had never thought of that.· Thanks for the idea!

    Mark
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-04 01:51
    Timmoore said...
    The ds3231 is I2c 3.3V but as you said is SOIC.
    Hi Tim,
    yes, I recall this now.· I meant to ask you where you got a breakout board for this chip.· I guess I'll have to invest in a real soldering iron and hang up my Walmart special.

    blush.gif·
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-04 01:57
    if I remember correctly I used this one http://www.sparkfun.com/commerce/product_info.php?products_id=495
    There are others around but they are either more expensive or take ~4 weeks to arrive. e.g. http://www.futurlec.com/SMD_Adapters.shtml
  • parts-man73parts-man73 Posts: 830
    edited 2008-09-04 04:11
    i thought I'd bring up this thread...

    http://forums.parallax.com/showthread.php?p=604475

    in the accompanying circuit diagram, Beau suggests supplying 3.3V to a DS1307 ?

    The Datasheet specifically states a minimum supply voltage of 4.5V, will it work at 3.3V? probably, but your mileage may vary.

    I've used a similar circuit to your drawing in the first post in this thread. I used the same i2c lines as the boot EEPROM, which are pulled to 3.3V with 4.7K resistors already (SpinStudio mainboard) I then used 1K resistors between the i2c bus and the DS1307. I connected the DS1307 supply to 5 Volts on my RTC ProtoCard.

    attachment.php?attachmentid=50731

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian

    uController.com - home of SpinStudio - the modular Development system for the Propeller

    PropNIC - Add ethernet ability to your Propeller! PropJoy - Plug in a joystick and play some games!

    SD card Adapter - mass storage for the masses Audio/Video adapter add composite video and sound to your Proto Board
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-04 04:28
    Thanks, Brian,
    the idea of running the DS1307 on 3.3 volts is tempting, since I have only a couple chips to play with right now and I'm trying to create a strategy of testing configurations that will "fail safe" and work my way from there. Also, I'm grateful you posted an example that worked for you, and your set-up sounds the most promising so far.

    a thousand thanks,
    Mark
  • RaymanRayman Posts: 14,360
    edited 2008-09-04 10:12
    No need to worry about 5V on the DS1307. No need for resistors...

    The i2c pins only sink, they don't source.· So, it can't harm the Prop. ·Adding resistors (beyond the existing pullups) may actually limit performance.

    The nice thing about the DS1307 in particular, is that it recognizes 3.3V as logic high, even when powered by 5V...

    Post Edited (Rayman) : 9/4/2008 10:17:48 AM GMT
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-04 13:21
    Hi Rayman,
    not only is that excellent news but it helps me understand how these chips talk to each other. The pins merely drop a voltage that is already supplied on the line (thanks to the pull up resistors) and do not "inject" a voltage of their own. Awesome.

    you made my day,

    thanks,
    Mark

    roll.gif
Sign In or Register to comment.