Shop OBEX P1 Docs P2 Docs Learn Events
SDA Pullup — Parallax Forums

SDA Pullup

NewzedNewzed Posts: 2,503
edited 2007-11-05 13:55 in Propeller 1
On the Propeller Demo board the SDA pullup resistor goes to Prop Res.· On the Proto Board the SDA pullup goes direct to Vdd.··Is either of these methods better than the other?

Sid

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.

That is why they call it the present.

Don't have VGA?
Newzed@aol.com
·

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-11-04 00:13
    The general idea behind the Demo board (and also the Hyda) circuit was that a "stuck" EEPROM should be released by a reset.

    AFAIK this was purely theoretical where on the other side this connection opened the door to immense noise on the SDA line...
    There was a very instructive thread about this some monthes ago, maybe in the Hydra forum... I can try to find it...
    But why do you ask??


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

    Post Edited (deSilva) : 11/4/2007 12:21:55 AM GMT
  • NewzedNewzed Posts: 2,503
    edited 2007-11-04 12:30
    @deSilva - I was laying out a new Prop board with my EEPROM module and it called for SDA to go to Res.· I was having difficulty making this connection on my single sided board, then I remembered the Proto Board arrangement - it·is a very simple matter to take SDA to Vdd.· I can do it right on the EEPROM module.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-04 13:04
    Well, then do it!
  • hippyhippy Posts: 1,981
    edited 2007-11-04 13:47
    @ Newzed : "Is either of these methods better than the other?" -- You never got a straight answer to that.

    Most I2C configurations take the pull-up(s) to Vdd and work, so I'd recommend that.

    Pull-up to RES is arguably better in theory but I've seen no evidence to show that it is better in practice and recall discussion on the forum of problems which have been caused by doing that.

    I'd personally recommend also adding an SCL pull-up if you do not want to have a hard-driven SCL line.
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-04 14:07
    hippy said...
    I'd personally recommend also adding an SCL pull-up if you do not want to have a hard-driven SCL line.

    .. though this is of not much advantage in single master configurations. All existing programs "drive" the clock line..

    Post Edited (deSilva) : 11/4/2007 2:12:27 PM GMT
  • hippyhippy Posts: 1,981
    edited 2007-11-04 20:47
    @ deSilva : Very true, I won't disagree there.

    Hard driving of SCL present problems which we could do without when trying to have multiple masters, or slaves which need to do clock stretching on that bus.
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-05 00:43
    Oh - I'd forgotten the clock stretching...
  • Tracy AllenTracy Allen Posts: 6,660
    edited 2007-11-05 05:02
    Yes, I'm using an ADC (MAX1239) that requires clock stretching. The ADC holds the clock line low after it receives the slave address, until the conversion is complete.

    Sid, RESn internally has a builtin pullup of ~5kohms to the brownout detector, which normally outputs =Vdd (note: BOEn has to tied low, enabled, for this to be true.) You can follow the example and connect sda to RESn through the 10k pullup. In combination with the internal 5k, that makes a total of 15k pullup to Vdd for sda . One reason to connect to RESn is to minimize the current drain during a brownout condition. In brownout, the brownout detector pulls the other side of that RESn pullup low, and that brings about reset of the Prop. But the side effect is that it also pulls the sda pullup low. If you had tied that sda pullup resistor to Vdd, there is a slim chance that the I2C line would be stuck in a low state, and the pullup resistor would be left passing current so long as the chip stays in brownout. That would be a relatively slim chance, I say, because the resting state of the I2C lines is input high with pullup.

    This was explained by Chip in this thread.

    Note that when sda is connected that way, you can see the voltage on RESn drop to about 2.2 volts (Vdd=3.3 volts) every time sda is pulled low by either the Prop or by the eeprom. That is not low enough to cause a Prop reset (which would be bad, of course!). It does decrease the noise margin though, as seen in the Hydra thread that deSilva pointed out. Furthermore, there is a speed hit from the 15kohm pullup in comparison with a 5kohm pullup you might otherwise use. Quite evidently, that works fine at least for low speed I2c for the eeprom. If you need to drive a longer I2c line, one having more I2c devices perhaps, the capacitance and therefore also the speed hit would be greater.

    If you want to use that same circuit to pull up _both_ sda and scl, then the resistors would have to be 20k, in order to keep activity on the I2c buss from resetting the prop. That would slow things down ever further and render it even more subject to noise. I suppose you could use a buffer on the RESn output in order to keep the advantage of brownout deactivation and also isolate the pullups from RESn directly.

    All in all, I'd recommend keeping things simple and connect sda and scl to Vdd via the ~5kohm pullups. Only consider the RESn connection or a variation of it if low power consumption in brownout is crucial.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 11/5/2007 5:17:10 AM GMT
  • NewzedNewzed Posts: 2,503
    edited 2007-11-05 13:55
    Thanks. Tracy.· I have both SDA and SCL tied to Vdd on my EEPROM module.· I'm using 10K resistors and will probably stick with those.· So far I have had no problems with the Prop resetting, even when I'm PWMing my Nichia RGB chips.· The PWM operates at about 400kHz and is strong enough to override the·13" TV I am using as a security monitor.· I normally get a good color pictue of my driveway, but when I use the PWM it blanks out completely.

    Take care.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Yesterday is history, tomorrow is a mystery, and today is a gift.

    That is why they call it the present.

    Don't have VGA?
    Newzed@aol.com
    ·
Sign In or Register to comment.