Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2016, 12:34:12 12:34


Login with username, password and session length


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

Posts: 136

Thank You
-Given: 282
-Receive: 48

What is this for?


« on: March 10, 2016, 12:20:15 00: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 x86 SP1 on HP6910p
solutions
Hero Member
*****
Offline Offline

Posts: 1446

Thank You
-Given: 587
-Receive: 851



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

Depends

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

Posts: 75

Thank You
-Given: 28
-Receive: 35


« Reply #2 on: March 10, 2016, 01:49:07 13: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
V.I.P
Active Member
*****
Offline Offline

Posts: 136

Thank You
-Given: 282
-Receive: 48

What is this for?


« Reply #3 on: March 10, 2016, 06:26:11 18: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, 06:43:39 18:43 by towlerg » Logged

Win 7 Ult x86 SP1 on HP6910p
Checksum8
V.I.P
Junior Member
*****
Offline Offline

Posts: 71

Thank You
-Given: 44
-Receive: 53


« Reply #4 on: March 10, 2016, 07:10:27 19: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: 102

Thank You
-Given: 47
-Receive: 33


« Reply #5 on: March 10, 2016, 10:51:11 22: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
V.I.P
Active Member
*****
Offline Offline

Posts: 136

Thank You
-Given: 282
-Receive: 48

What is this for?


« Reply #6 on: March 11, 2016, 12:33:09 00: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 x86 SP1 on HP6910p
Signal
Active Member
***
Offline Offline

Posts: 102

Thank You
-Given: 47
-Receive: 33


« Reply #7 on: March 11, 2016, 01:06:23 01: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, 01:30:01 01:30 by Signal » Logged

Give a right name to a right game and play it right
towlerg
V.I.P
Active Member
*****
Offline Offline

Posts: 136

Thank You
-Given: 282
-Receive: 48

What is this for?


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

@Signal

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

George
Logged

Win 7 Ult x86 SP1 on HP6910p
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