CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

I2C: PIC(5V) / Sensor(3.3V)
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

I2C: PIC(5V) / Sensor(3.3V)
PostPosted: Tue Apr 08, 2008 9:11 am     Reply with quote

I have a I2C pressure sensor that I wish to read using a PIC18F4685. The sensor runs at 3.3V and the PIC at 5V. I'm using the PCA9306 as a voltage-level translator. Will this setup work?

Thanks. Wink
Matro
Guest







PostPosted: Tue Apr 08, 2008 9:19 am     Reply with quote

That's not needed.
If you enter "I2C level shifter" in Google or other, you will find THE classical I²C level shifter that is just 2 MOSFETs and 4 pull-up resistors (2 for each side) and that perfectly works.

Matro
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

PostPosted: Tue Apr 08, 2008 9:23 am     Reply with quote

Well I already have the PCA9306.

But looking at the datasheet it would seem that the PIC must be 3.3V and the sensor 5V and not the other way around(the way I have it now).
Matro
Guest







PostPosted: Tue Apr 08, 2008 9:26 am     Reply with quote

If your PCA is well mounted so it will works.
But how can we know that since we don't have the schematic?...

Matro.
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

PostPosted: Tue Apr 08, 2008 9:40 am     Reply with quote

Here is the schematic:


(click to view full size)
Matro
Guest







PostPosted: Tue Apr 08, 2008 9:47 am     Reply with quote

It seems OK according to the datasheet.

Matro.
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

PostPosted: Tue Apr 08, 2008 11:05 am     Reply with quote

Is it normal for the PCA9306 to become really hot during operation?
Matro
Guest







PostPosted: Tue Apr 08, 2008 11:09 am     Reply with quote

No, there may be a short circuit on 1 or several lines.
Check impedance between each line and ground.

Matro.
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

PostPosted: Tue Apr 08, 2008 11:16 am     Reply with quote

There is a 2000Ohm impedance between each line and the ground.
Matro
Guest







PostPosted: Tue Apr 08, 2008 11:24 am     Reply with quote

That is a very small value.
You should have at least 10x the value of the pull-up resistors.
Further investigate to know why this impedance is so small.

Matro.
mskala



Joined: 06 Mar 2007
Posts: 100
Location: Massachusetts, USA

View user's profile Send private message

PostPosted: Tue Apr 08, 2008 2:53 pm     Reply with quote

The picture is small, I can't tell, do you have a 200K resistor from 5V to PCA9306 power? Why would you need a resistor there at all? Your pullups of ~348 ohms should work, but unless you have a long cable or high capacitance, in general I would use pullup values between 1K and 5K.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 08, 2008 4:22 pm     Reply with quote

Sample schematics for PCA9306:

Sheet 6 shows 2.2K pullups on each side:
http://c6000.spectrumdigital.com/davincievm/revd/files/DaVinciEVM_Schematic.pdf

Page 5 shows 3.3K on the +3.3v side, and 1.6K on the 5v side:
http://www.atmel.com/dyn/resources/prod_documents/doc32088.pdf

These are more normal pull-up values for i2c. 348 ohms is way low.
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

PostPosted: Wed Apr 09, 2008 6:53 am     Reply with quote

Thanks for replying. Smile

Everywhere I look the microcontroller is on the 3.3V side and the sensor on the 5V side. Me it's the other way around. Everything except the sensor is running at 5V, this is why I'm a bit confused about how to wire everything properly.
SET



Joined: 15 Nov 2005
Posts: 161
Location: Glasgow, UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Apr 11, 2008 10:59 am     Reply with quote

Why do you have the 5v side powered through a 200k resistor?
RageOfFury



Joined: 07 Feb 2008
Posts: 17
Location: Canada

View user's profile Send private message

PostPosted: Wed Apr 16, 2008 9:26 am     Reply with quote

SET wrote:
Why do you have the 5v side powered through a 200k resistor?

Well because that's the way its wired in the datasheet typical application example.

I am still having problems communicating with my sensor through the PCA9306. Is there another method I can use to interface a 5V PIC with a 3.3V I2C sensor?

Really need help here Crying or Very sad
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group