Shop OBEX P1 Docs P2 Docs Learn Events
Pullup and sinking SCL and SDA on I2C? — Parallax Forums

Pullup and sinking SCL and SDA on I2C?

Rick_HRick_H Posts: 116
edited 2011-09-08 17:34 in Propeller 1
I finally have some time to get back too my project but its been 9 months sense last time I touched this.
I was looking at all my data sheets for my project and found something I overlooked when I built and programed it. The MAX521 DAC is a 5V device and it requires 0.7VDD (3.5V) min for SCL and SDA. Currently I am sourcing 3.2V and it works but I am not sure after I put it on a board that something wont change. Should I pullup to 5V and sink, Leave it as is or is their some other method I could use to insure stability?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-06 11:16
    Use an I2C level translator for SDA and SCL. The simplest to implement is one of these:

    -Phil
  • Rick_HRick_H Posts: 116
    edited 2011-09-06 11:24
    That would be perfect, one problem is I have never etched or soldered surface mount. Is it difficult or is their another option?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-06 11:59
    You could use through-hole MOSFETs, as described in this document:

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-06 12:25
    I thought the Prop was fine with 5V as long as the current is limited.

    If Rick pulls the I2C lines up to 5V with 10K resistors, wouldn't that be fine for the Prop?

    I thought a 2.7K Ohm (or so) resistor was enough to limit the current from 5V to the Prop.

    Duane
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-06 12:40
    The problem you get into is when the Prop tries to pull the line low. The 10K plus 2.7K resistors make a voltage divider of 12.7K with a tap at 2.7K. You've got 5V across 12.7K = 0.4mA. The voltage across the 2.7K resistor is 1V. That's still just below the upper limit of a valid low input, but it's close and you'd lose some noise margin.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-06 12:40
    Duane,

    That might raise the high voltage enough, depending on the forward voltage of the protection diodes with such a low current. I normally prefer suggesting the "right" way to do things first and introducing the "cheats" only if the OP understands the caveats or says that the "right" way is impossible for one reason or another.

    Mike,

    I think he meant just a 10K pullup to 5V -- no series 2.7K.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-06 12:53
    I think he meant just a 10K pullup to 5V -- no series 2.7K.

    Yes, the 2.7K was my attempt at remembering the minimum safe value with 5V. I wouldn't use both 10K and 2.7K.

    Mike,

    I'm glad you said something about the voltage divider problem. While I wasn't suggesting using the two different resistors this time, I had wondered about such a set up at other times.

    Duane
  • Rick_HRick_H Posts: 116
    edited 2011-09-06 15:40
    Thanks Phil, the an97055 seams the right way to go.

    I still can't believe I overlooked that and its been working for over a year without fail. It's on a bread board at this time though and I'm sure it will fail once I make it and sell it to someone when thier in the middle of a performance or something crazy like that.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-06 17:27
    I hope Rick doesn't mind if I add to his "Solved" thread.

    I thought I had a good grasp on the I2C/open collector stuff.

    I remembered where I read the "open collector" term before (well, one of the many places). It was in the Propeller Backpack's manual. Here's a schematic from page 17.

    attachment.php?attachmentid=84869&d=1315354055

    So in this case the Propeller can only pull the com line down to 0.90V?

    Is this okay because 0.90V is low enough that a Basic Stamp (or a Propeller) would always read it as a logic low?

    Is this an example of a "cheat" or the "right" way? (I'm not being sarcastic, I'm not sure.)

    My guess is it's a bit of a "cheat" since the Backpack is such a small board. (A very cool product by the way.)

    Duane
    625 x 334 - 17K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-06 17:42
    Duane,

    LOL! I knew someone would bring that up. Yes, as the designer of the Backpack, I can tell you it's a "cheat". :) As you surmise, it has to do with board size: I simply ran out of room for anything more complicated. But, hey, it works. Given more room, though, I would have preferred to use a level translator.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-09-07 06:56
    Thanks for answer Phil.

    As I've mentioned before, I think the Backpack is a great little Propeller board.

    Duane
  • Rick_HRick_H Posts: 116
    edited 2011-09-07 22:50
    Bleh, I can't find any through hole Enhancement N MOSFETS. I'm just gonna drop a resistor in.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-07 22:54
    What about a 2N7000?

    They're plentiful and cheap.

    -Phil
  • Mark_TMark_T Posts: 1,981
    edited 2011-09-08 09:19
    TO220 size ones are easy to find ;)
  • Rick_HRick_H Posts: 116
    edited 2011-09-08 17:12
    Gate threshold voltage : VGS(th) min. 0.1V max. 2V - Gate threshold voltage : VGS(th) min. 0.8V Typical 2.1 max. 3V
    its the only parameter to not really match requirements but it should work.

    I spend too much time at mouser and allied, need to broden my horizons a bit, thanks again.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-08 17:34
    I guess that is cutting it a little close, although IDS in this app is so low, even 0.1V over VGS(th) might be enough. Still, if it's a concern, you could try this one instead:

    -Phil
Sign In or Register to comment.