Shop OBEX P1 Docs P2 Docs Learn Events
Help needed with electrical stuff — Parallax Forums

Help needed with electrical stuff

codemonkeycodemonkey Posts: 38
edited 2007-06-27 21:14 in Propeller 1
I have a DS1307 clock i'm trying to hook up to . I've read the thread·about using a resistor to drop 5v to 3.3v (have a 1k on the 3 lines i care about, SCL, SDA, and SQW) and pulled high (+5v for SCL and SDA, nothing for SQW) with a 10k. But won't the resistor drop the 3.3v lower when the signal (SCL and SDA) is controlled by·prop? Or is it still within the range of logical high for the clock? Or does the 10k resistor help in this situation? Sorry to be dumb about this kind of stuff, but i've always been a software guy and just learning hardware via ojt. Thanks.

p.s. Also aware about the prop object for the ds1307 but can't really use it until the clock is wired.

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-06-26 19:41
    You first have to understand what the serial resistor is meant for. It has nothing to do with voltage devision! Imagine that the impedance of input lines is very, very high, so there is little influence of a 1 k Ohm serial resistor both ways.

    Well, I cheated. There is a thing called input capacitance, making a serial resistor a low pass filter. This capacitance is about 10 nF, which will influence signals beyond 1/(2 pi R C) So don't use too high a resistor value....

    Back to the topic: What does the resistor do?

    Input pins generally have a protection circuit, consisting of a diode (sometimes called "clamp diode") to supply voltage. That means nothing when input voltage is lower than, even nothing when input voltage is about 0,5 V above supply voltage, but in all other cases.....

    Unlimited current would flow into the poor chip!!

    I cheated again smile.gif There is no such thing as unlimited current; there is always a resistor, thanks heaven!
    So the task of a serial resistor is to limit the current flowing into the input when voltage rises above 0,5 V above the supply voltage. On the safe side you can accept 1 mA. And if you can make sure that the source impedance of the driving chip is above
    (5V - 3,8 V)/1 mA = 1,2 k Ohm
    then you will need no resistor at all.

    Hope this illuminated the matter a little bit!

    Post Edited (deSilva) : 6/26/2007 7:47:18 PM GMT
  • AribaAriba Posts: 2,682
    edited 2007-06-26 21:00
    Hello codemonkey

    I had a look at the datasheet of the DS1307. The SCL is always an Input and need no serial Resistor. The SDA and SQW pins are "Open-Drain" outputs, that means they switch to Ground for a LOW, or are floating for a HIGH (They never supply 5V out of the pin). The minimal input voltage for a HIGH level is 2.2V, much lower then the 3.3V from the Propeller. So the connection is very easy. I have attached a modified Schematic from the Datasheet.

    Cheers Andy
    398 x 301 - 5K
  • deSilvadeSilva Posts: 2,967
    edited 2007-06-26 21:46
    Ariba said...
    I had a look at the datasheet ..
    Good thinking smile.gif Sorry I didn't
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-27 00:38
    As a side note the DS1302 runs at 3.3V directly...Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • codemonkeycodemonkey Posts: 38
    edited 2007-06-27 20:48
    Guys, thanks for your answers.

    deSilva - What i got from that is that a resister is not a voltage limiter, but a current limiter and that too much of a good thing is not a good thing. Also, the propeller can handle some limited overvoltage provided the current is properly limited. And that i have little control over the internal impedence of chips. Thanks for the background.

    Andy - I did look at the data sheet and schematic (though most of it might as well have been written in aramaic) and that's where i got the resistor values (moderated by what i had immediately on hand) plust the 5v interface to the propeller thread. I will immediately implement the schematic you supplied. Thanks.

    Chris - I did note your comment about the DS1302 being 3.3v but since i had the 1307 left over from playing with a Homework Board and i don't live within driving distance of an electronics store and i really hate it when s&h costs more than the part, i went with what was on hand. Thanks for letting me know and next time i will make sure i use the 1302.
  • Mike GreenMike Green Posts: 23,101
    edited 2007-06-27 21:14
    codemonkey,

    Maxim/Dallas and a number of other major chip manufacturers are very good about sending samples of their devices.· When you sign up for these, be honest ... they'll still send you the parts ... and they pay shipping ... it's really nice of them ... I have a lot of respect for them for doing this.
Sign In or Register to comment.