Help needed with electrical stuff
codemonkey
Posts: 38
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.
p.s. Also aware about the prop object for the ds1307 but can't really use it until the clock is wired.
Comments
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 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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
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.
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.