Level Translators For SPI™ and I²C Bus Signals - Maxim

Enter keywords or part number

What's New Products Solutions Design AppNotes Support Sales About Us Members

Maxim > Designer's Library > App Notes > [Interface Circuits]
Keywords: level translator, logic level translator, SPI, I2C, level translation
Related Parts
APP 1159: Aug 05, 2002
Download, PDF Format Download, PDF Format (60kB)

APPLICATION NOTE 1159

Level Translators For SPI™ and I²C Bus Signals

Abstract: A serial interface is often used for board-level communication between different integrated circuits, especially in space-constrained applications at low-to medium data-rates. The most popular serial interfaces are I²C and SPI™. If a system has different supply voltages for the µP and for peripheral devices, suitable level translators are required to be able to use one of these serial interfaces. There are several reasons why today? systems have two or more supply-voltages. High-speed µPs and DSPs are implemented on the most advanced processes to get maximum performance with the lowest power consumption. Another reason for different supply voltages is the use of ASICs or FPGAs together with a µP. For all these applications the designer needs a uni-or bi-directional level translator for the bus signals. The MAX3372E-MAX3379E/MAX3390E-MAX3393E family of level translators was designed to solve these problems.

A serial interface is often used for board-level communication between different integrated circuits, especially in space-constrained applications at low-to medium data-rates. The most popular serial interfaces are I²C and SPI™.

This application note describes I²C and SPI and some level-translation circuits that interface to them.

The SPI-bus has 4 signals: active-low CS = active-low Chip select, SCLK = Clock, DIN = Data In, and DOUT = Data Out.

Figure 1 illustrates the timing of these signals. The SPI-specification has a clock polarity (CPOL) and a clock phase (CPHA) bit. Figure 1 relates to the most common combination of these bits, CPOL = 0 (data-transfer on the rising clock edge) and CPHA = 0 (clock transitions in the middle of bit timing).

Figure 1. Signals and timing of the SPI-interface.
Figure 1. Signals and timing of the SPI-interface.

Several devices might be connected to the same bus, where all devices share the DIN and SCLK-line. Each device has a separate chip-select signal, so that the µP can address the appropriate part by the relevant active-low CS signal. If a chip does not talk back to the µP (e.g., DAC), the DOUT-line is not needed. The SPI-bus is well suited to data-rates to 20Mbps. Some devices (e.g., RTCs like the MAX6901) have a 3-wire interface, where the data-line is bi-directional. This interface is similar to SPI.

The I²C-bus has 2 signals: SCL = Clock and SDA = Data in/out.

Figure 2 illustrates the timing of the I²C-bus. Each device has a unique 7-bit or 10-bit address. As the data-line is bi-directional, only 2 wires are required, which is an advantage in space-constrained applications or in designs where different parts of the circuit have to be optically isolated. Data-rates for the I²C-bus are 100kbps, 400kbps, or even µP to 3.4Mbps for the high-speed mode. The I²C-bus requires pull-up resistors RP, where the value of RP depends on the supply-voltage and the bus-capacitance (number of devices connected to the bus and length of the bus).

Figure 2. Signals and timing of the I2C-interface.
Figure 2. Signals and timing of the I²C-interface.

If a system has different supply voltages for the µP and for peripheral devices, suitable level translators are required to be able to use one of these serial interfaces. There are several reasons why today's systems have two or more supply-voltages. High-speed µPs and DSPs are implemented on the most advanced processes to get maximum performance with the lowest power consumption. These processes are often limited to supply voltages of 3V or less. Typical core-voltages are 1.5V-2.5V. On the other hand, I/O-devices like DA-and AD-converters might have a supply-voltage of 3.3V or 5V to achieve the required dynamic range. In portable and low-power applications there is another reason to have the µP run with the lowest possible supply voltage. Current consumption of a typical microprocessor depends on clock frequency and supply voltage. One way to achieve low current consumption is therefore to reduce the supply voltage. This also leads to the situation where the µP runs from a different supply than other devices. Another reason for different supply voltages might be the use of ASICs or FPGAs together with a µP. For all these applications the designer needs a uni-or bi-directional level translator for the bus signals.

Figure 3 shows a basic level translator with an N-channel MOSFET. If neither Q2 or Q3 pulls the data-line low, VGS of Q1 is 0V and Data 1.8 has a level of 1.8V, Data 3.3 is at 3.3V. If Q2 pulls Data 1.8 low, VGS of Q1 is 1.8V and will turn on Q1, pulling Data 3.3 low. If Q3 pulls Data 3.3 low, the body diode of Q1 will be forward-biased, pulling the source to 0.3V. VGS will be 1.5V and Q1 will turn on, pulling Data 1.8 low. So logic-levels are translated in both directions. We assume here that Q2 has zero on-resistance. For a real application we would have to consider this on-resistance, which is 133Ω worst-case for an I²C-compatible output (0.4V at 3mA) or 22Ω for the 74LVC125 buffer (0.55V at 24mA). In this case the voltage VGS to turn on Q1 would no longer be 1.8V, but would be lower, depending on R1 and the on-resistance of Q1.

Figure 3. Basic level translator.
Figure 3. Basic level translator.

There are several problems associated with this circuit:

  1. With VL being 1.8V or even lower, the choice of suitable MOSFETs with a low enough VGS threshold voltage is rather limited. One candidate might be the TN2501 from Supertex.
  2. The slew-rate and, therefore, the maximum transmission rate depends on the value of R1/R2 and on the number of devices on the bus, which determines the capacitance. It is possible to increase the maximum transmission rate by choosing lower value resistors R1/R2. This will lead to higher current consumption, which is undesirable in portable/low-power applications.
  3. With this simple circuit it is not possible to tristate the bus and disconnect R1/R2. Therefore one cannot switch off segments of the bus.

The MAX3372E-MAX3393E family of level translators solves these problems. Figure 4 shows the simplified schematic of the MAX3373E, where two MOSFETs Q4 and Q5 have been added. Q4 and Q5 close for a short time during the rising edge and speed-up the low-to-high transition. Minimum guaranteed data-rate for the MAX3373E is 8Mbps, µP to 16Mbps is possible if |VCC - VL| < 0.8V. This family of level-translators has a three-state mode, where the pull-up resistors are disconnected. This makes them ideal in multidrop-networks or for controlling I²C-devices with the same address, where these devices are on different sections of the network, which are decoupled by a level translator.

The data-lines on the VCC-side are ±15kV ESD-protected, which is a valuable feature in applications where the bus is accessible on a connector and where ESD-strikes are likely to occur. A thermal-shutdown circuit puts these level-translators in the three-state mode if temperature exceeds 150°C.

Figure 4. Improved level translator MAX3373E with speed-up circuit.
Figure 4. Improved level translator MAX3373E with speed-up circuit.

Typical Applications

Figure 5 shows a typical application for the MAX3390E level translator in a battery-powered measurement circuit. A MAX4194 low-power instrumentation amplifier amplifies the signal from the bridge. The signal is AD-converted by the MAX1270, a 12-bit 8 channel ADC. The supply voltage for the analog front-end is 5V, the low-power µP has a supply of 2.5V. The MAX3390E level shifts the SPI signals from 2.5V to 5V and from 5V to 2.5V for the DOUT signal.

Figure 5. The MAX3390E level translator in an SPI-bus application.
Figure 5. The MAX3390E level translator in an SPI-bus application.

Figure 6 shows a similar application with an I²C-bus. The MAX3373E dual level translator is used to interface the µP I/O levels to the I²C-compatible interface of the MAX1236 (4 channel 12 Bit ADC).

Figure 6. MAX3373E dual level translator used in an IIC-bus application with optional pull-up resistors RPP.
Figure 6. MAX3373E dual level translator used in an IIC-bus application with optional pull-up resistors RPP.

Depending on the number of devices on the bus, optional pull-up resistors RPP might be required. The MAX3372E-MAX3393E family of level translators has internal 10kΩ pull-up resistors. In Figure 7 we can see that this is sufficient for a bus-capacitance of about 90pF, assuming we do not connect the optional resistor RS(RS = 0).

Figure 7. Maximum value of RP as a function of bus capacitance for a standard-mode I²C-bus, from I2C-specification.
Figure 7. Maximum value of RP as a function of bus capacitance for a standard-mode I²C-bus, from I²C-specification.

If there are several devices on the same bus or if the bus is relatively long (>30cm), it is necessary to use external pull-up resistors RPP. Figure 8 shows the minimum value of RP, which is 1.7kΩ for RS = 0 and VDD = 5V. From this we find the minimum value for RPP to be 2.2kΩ, so that RPP in parallel with the internal pull-up of 10kΩ is 1.83kΩ.

Figure 8. Minimum value of RP as a function of supply voltage with the value of RSas a parameter, from I2C-specification.
Figure 8. Minimum value of RP as a function of supply voltage with the value of RSas a parameter, from I²C-specification.

In summary, the MAX3372E-MAX3393E are ideal solutions to solve the I²C or SPI bus-level translation problems found in low-voltage systems. Guaranteed data rates, low power requirements, low-supply-voltage operability, and small packages help solve the many problems facing designers in bus architectures today.

SPI is a trademark of Motorola, Inc.

Related Parts APP 1159: Aug 05, 2002
MAX1236 | 2.7V to 3.6V and 4.5V to 5.5V, Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs | Full Data Sheet (PDF, 228kB) | Free Samples
MAX1270 | Multirange, +5V, 8-Channel, Serial 12-Bit ADCs | Full Data Sheet (PDF, 824kB) | Free Samples
MAX3000E | +1.2V to +5.5V, ±15kV ESD-Protected, 0.1µA, 35Mbps, 8-Channel Level Translators | Full Data Sheet (PDF, 236kB) | Free Samples
MAX3372E | ±15kV ESD-Protected, 1µA, 16Mbps, Dual/Quad Low-Voltage Level Translators in UCSP | Full Data Sheet (PDF, 496kB) | Free Samples
MAX3373E | ±15kV ESD-Protected, 1µA, 16Mbps, Dual/Quad Low-Voltage Level Translators in UCSP | Full Data Sheet (PDF, 496kB) | Free Samples
MAX3390E | ±15kV ESD-Protected, 1µA, 16Mbps, Dual/Quad Low-Voltage Level Translators in UCSP | Full Data Sheet (PDF, 496kB) | Free Samples
MAX4194 | Micropower, Single-Supply, Rail-to-Rail, Precision Instrumentation Amplifiers | Full Data Sheet (PDF, 728kB) | Free Samples

Automatic Updates
Would you like to be automatically notified when new application notes are published in your areas of interest? Sign up for EE-Mail™.

Member Comments
5 comments
Scott_T - I2C level translation (no rating)
2008-08-13
Because IIC outputs just pull low, do you actually need level translation to connect IIC between two chips with different VDD? Don't you just have pull up resistors on each line to the lowest of the two supply voltages? You would have to check that with the chosen resistor pull-up goes above the high threshhold and each output can pull the line below the low threshhold.
isa_2006 - I2C level translation (no rating)
2008-09-16
pull resistor is sufficient only if the IO of the device with low VDD tolerates the highest VDD. for example while interfacing a 3.3V device to a 5V device, the IO pin of 3.3V device must be 5V tolerant.
therese - Re: I2C level (no rating)
2008-09-16
Scott_5, ISA,

The reason for which the solution proposed will not work is because the SDA and SDL lines of the I2C interface are bidirectional for all parts, both master and slaves. That means that need to act both as inputs and outputs at different times in the interface protocol. Also, the VIH and VIL of the devices used in a system can be of two types, fixed input levels or VDD related input levels (VIH and VIL are fractions of VDD).

In a mixed VDD voltage system (usually some parts powered by a VDD supply higher than the master microcontroller) a simple pull-up resistor to the lowest VDD for each line will not satisfy in most cases the VIH requirements of the inputs of the higher VDD powered parts. A pull-up to the higher VDD will probably violate the absolute maximum rating of the parts with the lower VDD specification.

In those cases a bidirectional level translator is a good solution.

Download the Philips I2C Bus specification document.

See Table 4 (Characteristics of the SDA and SCL I/O stages for F/S-mode I2C-bus devices) in "The I2C-Bus Specification, Version 2.1, January 2000": http://www.nxp.com/acrobat_download/literature/9398/39340011.pdf

Regards,
Applications Engineering
Technical Support
Maxim
Curt - Interfacing Issues (no rating)
2009-01-28
Are pull up resistors needed when using the max3378 for spi communications or can 3378 be connected directly between microcontroller and spi device?
Hanif - Hanif (no rating)
2009-02-05
Curt,

The MAX3378E features 10k-ohm internal pull-up resistors for each of the I/O VL and I/O Vcc lines to their respective power supplies. Thus, you can connect directly.

Regards,
Applications Engineering
Technical Support
MAXIM
5 comments
Your Comments
Login or register to post a comment.

We Want Your Feedback!

Download, PDF Format Download, PDF Format (60kB)
AN1159, AN 1159, APP1159, Appnote1159, Appnote 1159

• • Privacy Policy • Legal Notices

Copyright © 2009 by Maxim Integrated Products


Survey Invitation Page

Close
Site logo ForeSee Results logo
Thank you for visiting the site!

You have been selected to take part in a customer satisfaction survey. This survey is conducted by an independent company, ForeSee Results, Inc.

The feedback obtained from this survey will help us to enhance our website. All results are strictly confidential.