Level converters to make all your hardware (5.5V and under) play with each other

I finally set aside some time for one of my own projects. I have been playing around with ARM microcontrollers a lot lately and wanted to try out my GLCD display that uses the KS0108 protocol. It’s 5V but I had heard that some of these displays will work with 3.3V TTL. But the datasheet tells me otherwise. I tried using a pull-up resistor to 5V and configuring the Stellaris Launchpad pins to open drain, but the low voltage wasn’t getting below the 0.3V threshold needed by my display. My only choice was to use some type of level conversion. I actually ended up driving the KS0108 using a pair of TXB0108 level converters.

I figured this had to have been done before so I check over at Sparkfun. Their offerings are either one-way or have a direction pin that you must drive yourself. I figured there had to be a bi-directional solution and a search over at Mouser led me to the TXB0108. It is exactly what I was looking for and as you can see I etched my own circuit boards to make the TSSOP chips breadboard compatible. I’ve documented the process you can find the code and board files at my post linked above.

In addition to Adafruit’s breakout board for the TXB0108, they also carry a breakout board using FETs (http://adafruit.com/products/757). It’s intended for I2C level conversion, since the TXB/TXS series direction sensing can get confused with the inclusion of pull-up or pull-down resistors (found that out the hard way). I’m still learning about this topic; in one project I have an Arduino TFT LCD shield at 5v, a Teensy 3.0 at 3.3v and a color sensing chip (TCS34717) which communicates over I2C at 1.8V. That being said, for most applications, if you can get the connections right the TXB/TXS series is definitely the way to go.

That chip looks like a good packaged solution, although I am a bit more partial to the ‘simplicity’ of the FET design. I’m still trying to find some reasonable solutions to High Speed (3.4 MHz) I2C though, since neither the chips discussed or the FET solutions work well there.

I’ll second this post. The FET based solution has been around for many years and seems to work well. I even built a version of this for a breadboard by soldering wires onto surface mount FETs I had on hand in the parts bin.

Bidirectional Level-Converters with autosensing are a bit slower, you can’t go high speed with them. Texas Instruments has a big range of products there (surprise) and i got myself some of those with direction pins for use with SPI (µSD-Card to Atmega32u4) which would not work properly with autosensing converters.

“But I still get some garbage on the display from time to time. This can usually be fixed by straightening out the jumper wires, which is what makes me thing it is a cross talk problem.”

Could be. Another possibility is that some of your breadboard or female header connectors aren’t making a decent connection, which I find more common in recent years as both become more cheaply made. Rearranging wires can make it better (or worse), as it changes the tension on the connection.

Fortunately, you don’t need an oscilloscope to diagnose this. Attach a 2.2K resistor across the terminals of a piezo tweeter. Output a steady, active logic high (or low if needed) at the source on all signal lines you want to check. Connect one terminal of the piezo to a signal destination, and the other terminal to ground (or VCC, if the signal is driven low). Wiggle the wire and connector. You’ll be able to hear the slightest fault as a crackle. Repeat with remaining signals.

Piezo tweeters are very useful as cheap test equipment. Connected between VCC and GND (without the resistor of course), I’ve also used them to find locations where supply rails sag, and need additional bypass capacitors. And tracked the source of noise in an audio circuit to a poor switching power supply. I can hear fluctuations as small as 10mV in a quiet room, with the tweeter near my ear. In some cases, it will also reveal issues in digital signals, especially repetitive ones; for example, glitches or jitter in a PWM signal are easily heard.

I’ve got the original MSP430 launchpad at 3.3V driving a string of WS2801 LED drivers running at 5V. Out of spec but it will run fine at 4Mhz (not 8,certainly not the 25 from the datasheet). Hooray for de-rating.