Shop OBEX P1 Docs P2 Docs Learn Events
Pull up resistor for 24LC256 — Parallax Forums

Pull up resistor for 24LC256

EnriqueEnrique Posts: 90
edited 2009-01-29 05:51 in Propeller 1
Hi,
·
In a project I’m building I will be connecting a 24LC256 EEPROM to a PX32A-Q44 Propeller.
·
In the Propeller Datasheet there is a Propeller Demo Board schematic in which the SDA line of the EEPROM has a 10K pull up resistor, but in the schematic for the #3812 Proto Board both the SDA and SCL lines have pull up resistors. Are both needed?
·
·
Thanks,
·
Enrique

Comments

  • LeonLeon Posts: 7,620
    edited 2009-01-25 17:33
    Only if you are going to put other devices on the same I2C bus.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • EnriqueEnrique Posts: 90
    edited 2009-01-25 17:51
    Thanks
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-26 00:15
    The specifiation says you should put a pullup on both. Suggest you do that - my pasm driver will require pullups on both lines.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz
  • virtuPICvirtuPIC Posts: 193
    edited 2009-01-28 18:50
    I just had a look at the datasheet. In section 2.2 they say that serial data (SDA) is an 'open drain terminal'. This means you need a pullup on the data line - no matter whether you use one or many I2C slaves.

    I have not checked it so far, but I suspect that this is an I2C feature.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • Andrew E MileskiAndrew E Mileski Posts: 77
    edited 2009-01-28 19:12
    Only masters control the clock, so if the master's output isn't open drain, no pull-up is needed if it can source the current.

    However the data line is bidirectional, and always needs a pull-up.

    Here's the I2C spec.

    The value of the pull-up depends on the number of devices on the bus. Refer to 16.1 "Maximum and minimum values of resistors Rp
    and Rs for Standard-mode I2C-bus devices"


    EDIT: Here is the latest I2C 3.0 spec from NXP (founded by Philips, the creators of I2C)..

    Post Edited (Andrew E Mileski) : 1/28/2009 7:24:36 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2009-01-28 20:11
    Andrew E Mileski said...
    Only masters control the clock, so if the master's output isn't open drain, no pull-up is needed if it can source the current.
    This is a common misconception about the I2C bus. Slaves can control the clock, too, by holding it low to pace the transfer. One must always read the data sheet to see if a particular device implements this so-called "clock hold" function. (The 24LC256 does not.)

    IMO, it's false economy to cut corners in a design just to save the cost of a resistor.

    -Phil
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-29 02:34
    Also, you can improve the speed and reduce the instruction count if SCL has a pullup. My pasm driver uses this (incomplete) which will be used to read/write to >32KB eeprom. I need it to be small. Chips prop boot code does not require a pullup as it drives the SCL. Put in the resistor (or at least make room for it)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-01-29 03:30
    How can passive pullup be faster than direct drive? (Unless you are implementing the complete I2C spec)

    True, it doesn't hurt to include a pullup on the SCL line but the reality is that there is not a single I2C device I have ever come across that can or will try to assert the SCL itself which a slave device if capable is allowed to do to pause the transfer. Multi-master I2C will need a pullup on the SCL line but I haven't seen an implementation of that either.

    IMO however, to avoid confusion about this simple matter it might be wise if all schematics show a pullup on SCL.

    SUMMARY: ALways include a pullup on the SDA and SCL liness but don't be confused if you don't see a pullup on SCL on other designs. The pullup is normally 10K for short connections but can safely be decreased to 2K2 or less.

    *Peter*
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-01-29 05:51
    Sorry Peter, I wasn't clear. Faster in pasm (software point of view) but really it doesn't matter as the prop is fast enough. I am using waitcnt to time the eeprom clocking. I REQUIRE a minimum footprint in pasm and therefore will NOT be driving the SCL line, but rather controlling the DIR bit in a wired or situation, just as SDA is used.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Prop Tools under Development or Completed (Index)
    · Emulators (Micros eg Altair, and Terminals eg VT100) - index
    · Search the Propeller forums (via Google)

    My cruising website is: ·www.bluemagic.biz
Sign In or Register to comment.