1
\$\begingroup\$

So can a 3.3v mCu directly communicate via i2c to a 5v mCu ? the buss will be pulled to the lower voltage 3.3v. And since i2c protocols involves just sinking current is what makes me think it will work

\$\endgroup\$
4
  • 1
    \$\begingroup\$ This depends on the specific devices... I'm also not sure why you say that "I2C protocols involves just sinking current"? I2C is very much a voltage-level protocol... \$\endgroup\$
    – Ron Beyer
    Commented Jan 3, 2021 at 17:27
  • \$\begingroup\$ @RonBeyer, they probably mean that the 5-V device won't be driving 5 V onto the bus because it has an open-drain driver rather than totem-pole. \$\endgroup\$
    – The Photon
    Commented Jan 3, 2021 at 17:34
  • \$\begingroup\$ Maybe, if the 3.3V device is 5V tolerant. You really need to say what exact devices you are using. \$\endgroup\$
    – Justme
    Commented Jan 3, 2021 at 17:39
  • \$\begingroup\$ the answer to electronics.stackexchange.com/questions/539731/… may be relevant to this question \$\endgroup\$
    – V.V.T
    Commented Jan 3, 2021 at 19:23

2 Answers 2

2
\$\begingroup\$

It depends what the \$V_{ih}\$ minimum level is on the 5 V device. You can look this up in the datasheet. If it's lower than 2.7 V or so, then you should be okay.

This is a plausible scenario if your 5-V device uses TTL logic levels rather than CMOS. However, the I2C Standard defines the input levels roughly as CMOS levels, so this would require a non-standard device.

With standard-compliant devices it won't be possible, because \$V_{ih}({\rm min})\$ is \$0.7\times V_{dd}\$ and \$0.7\times 5\ V = 3.5\ V\$.

As pointed out in comments, if your 3.3-V device has 5-V-tolerant inputs, you may be able to connect the two devices together directly with the pull-ups to 5 V instead of 3.3 V. Again, check your datasheets. Again this would not be compliant with the I2C standard, but many microcontrollers are not strictly compliant.

\$\endgroup\$
3
  • \$\begingroup\$ The other way is more likely to work - many 3.3V MCUs have 5V tolerant IO pins, especially for I2C pins. \$\endgroup\$
    – Justme
    Commented Jan 3, 2021 at 17:40
  • \$\begingroup\$ D'oh! My bad, sorry. \$\endgroup\$ Commented Jan 3, 2021 at 17:53
  • \$\begingroup\$ @Justme I do apologize for not providing an IC as this is just a random question i cant get out of my head. So the next time i ever encounter a situation where i need to connect 3.3v and 5v i2c logics, check if the 3.3 version i2c pins are 5v tolerant before adding a level shifter circuit? \$\endgroup\$
    – DrakeJest
    Commented Jan 4, 2021 at 17:27
3
\$\begingroup\$

Don't build a product to sell like you described, but if you are playing around with a home project, it will work well enough to get by.

I use MSP430 MCUs with 3.3V IO with 5V I2C LCD displays. I had to remove the 5V pull-ups on the LCD PWB and add my own 3.3V pullups. Works fine.

Worst case CMOS logic high is 70%, but a typical part switches close to 50%. 70% of 5V is 3.5V, 50% is 2.5V.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Beware, some 5V devices have I2C ports with Schmitt trigger inputs that do have a higher threshold voltage. \$\endgroup\$ Commented Jan 3, 2021 at 20:53
  • \$\begingroup\$ Its not even a home project, let alone a product to sell. Just a random question i cant get my mind off. I do apologize i was not able to specify an IC \$\endgroup\$
    – DrakeJest
    Commented Jan 4, 2021 at 17:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.