The Godfather talking
You may crack software. How about me?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 20, 2024, 09:16:26 09:16


Login with username, password and session length


Pages: [1]
Print
Author Topic: Mixed voltage I2C  (Read 3924 times)
0 Members and 1 Guest are viewing this topic.
towlerg
Senior Member
****
Offline Offline

Posts: 263

Thank You
-Given: 474
-Receive: 104

What is this for?


« on: March 09, 2016, 11:20:15 23:20 »

Using a 5v PIC talking to a 3.3v device via I2C. Is it safe to simply tie I2C pullup resistors to 3.3v rail or should I use full on bi-directional logic level convertor?

George
Logged

Win 7 Ult x64 SP1 on HP2570p
solutions
Hero Member
*****
Offline Offline

Posts: 1823

Thank You
-Given: 655
-Receive: 900



« Reply #1 on: March 10, 2016, 06:36:02 06:36 »

Depends

What's the mystery "device" (don't answer if it blows your MI5 cover)?
Logged
PICker
Active Member
***
Offline Offline

Posts: 162

Thank You
-Given: 207
-Receive: 109


« Reply #2 on: March 10, 2016, 12:49:07 12:49 »

Several answers:
http://www.microchip.com/forums/m440988.aspx
http://www.edaboard.com/thread171379.html
https://www.ccsinfo.com/forum/viewtopic.php?p=43813
Have a look also to this document:
http://ww1.microchip.com/downloads/en/DeviceDoc/chapter%208.pdf
Logged
towlerg
Senior Member
****
Offline Offline

Posts: 263

Thank You
-Given: 474
-Receive: 104

What is this for?


« Reply #3 on: March 10, 2016, 05:26:11 17:26 »


@solutions
Quote
What's the mystery "device" (don't answer if it blows your MI5 cover)?

Sorry, wasn't trying to be mysterious, just didn't want to include meaningless details. In this particular case, it's just 'cause I'm curious.


@PICKer

Thanks for those. I had in fact seen them and loads more like them. The CCS one is just plain wrong
Quote
Selection of any I2C mode with the SSPEN bit set,
forces the SCL and SDA pins to be open drain,

I'm gonna see what my friend Proteus has to say.

George
« Last Edit: March 10, 2016, 05:43:39 17:43 by towlerg » Logged

Win 7 Ult x64 SP1 on HP2570p
Checksum8
Active Member
***
Offline Offline

Posts: 129

Thank You
-Given: 123
-Receive: 100


« Reply #4 on: March 10, 2016, 06:10:27 18:10 »

You can use this bi-directional level shifter from Sparkfun. It's basically from the NXP app.
Schematic link on this page
https://www.sparkfun.com/products/12009
Logged
Signal
Active Member
***
Offline Offline

Posts: 197

Thank You
-Given: 111
-Receive: 81



« Reply #5 on: March 10, 2016, 09:51:11 21:51 »

Using a 5v PIC talking to a 3.3v device via I2C. Is it safe to simply tie I2C pullup resistors to 3.3v rail or should I use full on bi-directional logic level convertor?
Typical value for minimum input high voltage for I2C pin of 5V PICs is 0.7*Vdd =~ 3.5V @5Vdd. Even with reduced Vdd=4.4 V and threshold about 3.1V the more "upper space" is needed due to RC slope.
But simple answer - I2C module is intended to work with pull-ups to Vdd supplying this module so converter is needed.

You can use this bi-directional level shifter from Sparkfun. It's basically from the NXP app.
http://www.nxp.com/documents/application_note/AN10441.pdf
I doubt that this circuit is an NXP invention though.
In case of missing n-MOSFETs close at hand they can be replaced by NPN transistors with additional serial resistor in base.
Specialized level converters for I2C are more speedy and could have signal conditioners built-in. So there is no universal suggestion what to use.
Logged

Give a right name to a right game and play it right
towlerg
Senior Member
****
Offline Offline

Posts: 263

Thank You
-Given: 474
-Receive: 104

What is this for?


« Reply #6 on: March 10, 2016, 11:33:09 23:33 »

@Checksum8
I know I can use level level convertors, my question is, do I have to?



@Signal
Looks like we have a winner. I didn't realize that a PIC needed such a high level to "see" a one.

The standard cuircuit using mosfets seems to have pullups on both low voltage in/out and high voltage in/out. So the pullup I2C resistor should be increased to allow for the two resistor in parallel. Best I can tell the sparkfun/ebay units use 10k, so my I2C pullup will be 8.2k?

George
Logged

Win 7 Ult x64 SP1 on HP2570p
Signal
Active Member
***
Offline Offline

Posts: 197

Thank You
-Given: 111
-Receive: 81



« Reply #7 on: March 11, 2016, 12:06:23 00:06 »

Looks like we have a winner. I didn't realize that a PIC needed such a high level to "see" a one.
Did not know that it was a competition. Feel free to read a datasheet for chosen IC - you will find many interesting things there Wink
« Last Edit: March 11, 2016, 12:30:01 00:30 by Signal » Logged

Give a right name to a right game and play it right
towlerg
Senior Member
****
Offline Offline

Posts: 263

Thank You
-Given: 474
-Receive: 104

What is this for?


« Reply #8 on: March 11, 2016, 04:25:41 04:25 »

@Signal

Sorry, didn't mean to offend. Simply meant that yours was a definitive answer.

George
Logged

Win 7 Ult x64 SP1 on HP2570p
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC