Level Translation Circuit

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey all,

I am trying to level shift SPI bus communication from 5V to 3.3V. I am using a circuit similar to the solution shown in Phillips App Note AN97055, except that I am using the BSS138 MOSFET. I am using a 100ohm resistor on the gate of the MOSFET to dampen some of the ringing, which was causing my waveforms to distort. The pullup resistors on both the 5V side of the MOSFET and 3.3V side of the MOSFET are both 10kohm.

The issue I am having is that the waveform with this current setup has a peak voltage of 4.0V and low voltage of approximately 1.0V. Obviously this is not meeting the 3.6V LVTTL logic levels. When I attempt to adjust the gate resistor to get a peak voltage of 3.6V, the low voltage is 1.4V. Adjusting the pullup resistors seems to have little effect.

I could try to run the AVR at 3.3V as it would be in the safe operating range running at 8.0MHz, but I would like not to have to spin the board again and would like to learn how to level translate.

Below is an image of the waveforms. The yellow colored waveform on top is the 5V output from the AVR going to the MOSFET (specifically the SPI CLK signal), and the cyan colored waveform on bottom is the output through the MOSFET.

I would appreciate any help on this.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice picture
A better picture would be a schematic

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This circuit is not suitable for high frequencies because it is 'open drain'. It was designed for I2C. Try at lower frequencies and your waveforms will get better.
You need push-pull output for high frequencies. SPI is not bidirectional, so you no need open drain configuration.

From 5 to 3.3 you can use a simple resistor divider. From 3.3 to 5 you can try to connect directly. If you can afford a diode on the 5V path to the micro would help, so you will run the micro at 4.3V.

George.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simple resistor dividers for 5V to 3V3 conversion are not for very high speed either. And directly feeding 5V chip with 3V3 logic signal may have problems working too.

Use a logic chip that is powered with 3V3 but can tolerate 5V signals on its input for the 5V to 3V3 conversion (74LCX series comes to mind), and for the other direction, a 5V powered chip that can reliably work with 3V3 signal levels (74HCT series comes to mind).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks all for the input. I thought I might be able to make the MOSFET solution work, but I will give the logic buffer solution mentioned above and in the sticky a try.