Forum Index
SPI 3.3v to 5v
Goto page 1, 2
 
Author Message
sturgessb



Joined: 25 Apr 2008
Location: Norwich, UK

Posted: 30 April 2008, 13:39 PM    Post subject: SPI 3.3v to 5v

Hi again Guys

Wanting to hook up my 3.3v sensor via SPI. Presumably i need some form of protection for the sensor, as its hooking up to 5v logic device.

is the example on the following page correct, using 10k resistors?
http://www.sparkfun.com/commerce/present.php?p=Sensor-Interfacing

Cheers

Ben
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 30 April 2008, 14:24 PM    Post subject: Re: SPI 3.3v to 5v

sturgessb wrote:
is the example on the following page correct, using 10k resistors?
That will works for signals from the 5V device to the 3.3V device assuming the latter has clamping diodes on it inputs (consult the datasheet). The signal that might cause a problem is MISO - a 3.3V output driving a 5V input. The specification for the AVR chips indicates that the minimum voltage that is guaranteed to be recognized as a logic 1 is 0.6 * Vcc, nominally 3.0 volts with a 5.0V supply. You'll have to check the data sheet for your device to find out what the minimum logic 1 output voltage is. If it is above 3.0 volts across the temperature and load ranges then you're all set. Otherwise, you'll need to look at some options for level shifting the 3.3V output to 5.0. There are some ideas in AN-213 External Device Interfacing in the section entitled "Interfacing to Lower Voltage Devices".
Back to top
twesthoff



Joined: 17 Mar 2006
Location: Virginia, USA

Posted: 30 April 2008, 15:27 PM    Post subject: SPI 3.3v to 5v

If you really want to do it right, you should use an interface chip such as the Maxim MAX3000E (www.maxim-ic.com)
But some of the Sparkfun methods will work depending on your application.
Back to top
sturgessb



Joined: 25 Apr 2008
Location: Norwich, UK

Posted: 01 May 2008, 12:43 PM    Post subject:

would I need one of these translators for each line?
Back to top
twesthoff



Joined: 17 Mar 2006
Location: Virginia, USA

Posted: 01 May 2008, 13:44 PM    Post subject: SPI 3.3v to 5v

The Maximum chip mentioned earlier has 8 translators in the package. They work both directions (input and output).

You will have to use some kind of translation circuit for each line that needs to go from 3.3 to 5V or the other direction.


Subject: RE: SPI 3.3v to 5v

would I need one of these translators for each line?
Back to top
stevech



Joined: 23 Feb 2006

Posted: 02 May 2008, 2:35 AM    Post subject:

Not guaranteed to work at all temperatures and conditions, but I have the SPI from a 5V Atmel mega chip's SPI connected to a WizNet '5100 chip running on 3.3V. No voltage translator.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 02 May 2008, 3:22 AM    Post subject:

stevech wrote:
No voltage translator.
With or without current limiting resistors?
Back to top
stevech



Joined: 23 Feb 2006

Posted: 02 May 2008, 6:25 AM    Post subject:

without.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 02 May 2008, 23:41 PM    Post subject:

stevech wrote:
without.
That seems problematic. If you think about how the clamping diodes on the input lines of the 3.3V device are connected, you essentially have a circuit like this:
Code:
+5V o---------->|--------o +3.3V

In that configuration, the clamping diode will have a short life if the maximum output high current of the 5 volt device exceeds the maximum allowable current for the diode. A series resistor will limit the current to safe levels and if it is not too large will not affect the logic levels seen by the lower voltage device.
Back to top
stevech



Joined: 23 Feb 2006

Posted: 03 May 2008, 3:52 AM    Post subject:

Re the WizNet 5100 chip that is on the Wiz810MJ modules that I have - the data sheet says "I/O pins are 5V tolerant". Your comment inspired me to not be so lazy and look at the specs:


Wiz5100 grab1.jpg
 Description:
 Filesize:  46.64 KB
 Viewed:  3554 Time(s)

Wiz5100 grab1.jpg


Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 03 May 2008, 4:31 AM    Post subject:

stevech wrote:
Your comment inspired me to [...] look at the specs:
Always a good strategy.

In contrast to your device, the LIS3LV02DQ that sturgessb is working with has the specifications shown in the attachment. Although the datasheet does not specifically mention it, the Vdd_IO+0.3V suggests that the inputs are protected by (Schottky) clamping diodes. (The 0.3V is within the normal range of forward voltage for a Schottky diode.)

In the case of this device, current limiting resistors are definitely recommended. Unfortunately, the datasheet is silent with regard to the maximum current that can be tolerated by the clamping diodes. A 3.3K resistor would limit the current to about 0.5mA, a value that is probably under the maximum allowable current.



LIS3LV02DQ.jpg
 Description:
 Filesize:  21.56 KB
 Viewed:  3550 Time(s)

LIS3LV02DQ.jpg


Back to top
sturgessb



Joined: 25 Apr 2008
Location: Norwich, UK

Posted: 04 May 2008, 1:41 AM    Post subject:

I have tried the resistor solution. And I can't seem to establish any communication over SPI.

So unless im doing something wrong with either wiring or code, it seems thats not at option for me at the moment. Frustrating as the I2C is a little to slow for me.

Silly question, but does the zx have to run at 5v? whats stopping it from running at 3.3v?
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 04 May 2008, 2:10 AM    Post subject:

sturgessb wrote:
does the zx have to run at 5v?
No. It can run at a lower voltage. However, if you want to run it within the specifications you have to observe the speed/voltage derating curve shown in the attached image. The derating curve is linear between 2.7V and 4.5V so it is easy to calculate the minimum operating voltage when running at 14.7456MHz: 47.456% of the distance between 2.7V and 4.5V is 3.55V. In all likelihood, your ZX will run without problems at 3.3V but that is out of spec. That said, I would strongly advise against trying to do a firmware update with the voltage out of spec.

The other option is to run the LIS3LV02DQ at 5V. Since it is calibrated at 2.5V you'll have to do some computations to get the correct results. See the datasheet for details.



mega644P_speed_vs_voltage.jpg
 Description:
 Filesize:  18.07 KB
 Viewed:  3528 Time(s)

mega644P_speed_vs_voltage.jpg


Back to top
sturgessb



Joined: 25 Apr 2008
Location: Norwich, UK

Posted: 04 May 2008, 12:05 PM    Post subject:

Ok, sounds interesting. Don't think i could run the sensor at 5v and it survive for too long.

Does anyone have any real world experience with running zx-128 at 3.3v?
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 04 May 2008, 15:10 PM    Post subject:

sturgessb wrote:
Don't think i could run the sensor at 5v and it survive for too long.
I thought that I read in the datasheet that it could run at up to 6 volts. Upon reviewing that, I see that although the chip will survive 6 volts on Vdd, they don't claim that it will operate correctly at that level.

sturgessb wrote:
Does anyone have any real world experience with running zx-128 at 3.3v?
One of my customers has a battery powered device using a ZX that they run down to 3.5V. At one time, they let it operate all the way down to 3.3V but found that they couldn't reliably update the firmware with the lower threshold.

Some time ago, I experimented with running a ZX-24a at 3.3V. The test program ran for two days with no problems at which time I terminated the experiment.

You mentioned that the current limiting resistor method didn't work for you. Did you try any of the other level converter methods that are described in the application note AN-213?
Back to top
Display posts from previous:   
Page 1 of 2

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group