View previous topic :: View next topic |
Author |
Message |
RageOfFury
Joined: 07 Feb 2008 Posts: 17 Location: Canada
|
I2C: PIC(5V) / Sensor(3.3V) |
Posted: Tue Apr 08, 2008 9:11 am |
|
|
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. |
|
|
Matro Guest
|
|
Posted: Tue Apr 08, 2008 9:19 am |
|
|
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
|
|
Posted: Tue Apr 08, 2008 9:23 am |
|
|
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
|
|
Posted: Tue Apr 08, 2008 9:26 am |
|
|
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
|
|
Posted: Tue Apr 08, 2008 9:40 am |
|
|
Here is the schematic:
(click to view full size) |
|
|
Matro Guest
|
|
Posted: Tue Apr 08, 2008 9:47 am |
|
|
It seems OK according to the datasheet.
Matro. |
|
|
RageOfFury
Joined: 07 Feb 2008 Posts: 17 Location: Canada
|
|
Posted: Tue Apr 08, 2008 11:05 am |
|
|
Is it normal for the PCA9306 to become really hot during operation? |
|
|
Matro Guest
|
|
Posted: Tue Apr 08, 2008 11:09 am |
|
|
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
|
|
Posted: Tue Apr 08, 2008 11:16 am |
|
|
There is a 2000Ohm impedance between each line and the ground. |
|
|
Matro Guest
|
|
Posted: Tue Apr 08, 2008 11:24 am |
|
|
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
|
|
Posted: Tue Apr 08, 2008 2:53 pm |
|
|
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
|
|
|
RageOfFury
Joined: 07 Feb 2008 Posts: 17 Location: Canada
|
|
Posted: Wed Apr 09, 2008 6:53 am |
|
|
Thanks for replying.
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
|
|
Posted: Fri Apr 11, 2008 10:59 am |
|
|
Why do you have the 5v side powered through a 200k resistor? |
|
|
RageOfFury
Joined: 07 Feb 2008 Posts: 17 Location: Canada
|
|
Posted: Wed Apr 16, 2008 9:26 am |
|
|
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 |
|
|
|