Posts 21, Those passive level converters, using a N-channel mosfet and 2 resistors, are really only good to use for I2C. Their big weakness is the high level output on either side is only due to the weak pullup resistor, so the low-to-high output is very slow. Because high-to-low is much faster, they result in a distorted waveform output, which is terrible for WS LEDs where the width of the pulses matters. Even just connecting extra wire to the output, especially when experimenting on a breadboard, can really alter the low-to-high speed. Unfortunately, Adafruit, Sparkfun and others have sold that level convert circuit as a general purpose solution, which though it performs really well only with certain protocols like I2C. Adafruit revised their description a few month ago from an overly optimistic "good for everything" sales pitch to a much more conservative approach.
|Published (Last):||15 May 2004|
|PDF File Size:||11.8 Mb|
|ePub File Size:||13.45 Mb|
|Price:||Free* [*Free Regsitration Required]|
Considering I only knew how to use resistors as voltage dividers, I decided to learn a bit more about voltage level shifting. Simple low to high conversion: Flexible logic levels When interfacing a 3. For example, the ATtiny13 datasheet specifies input low voltage as anything less than 0.
However, you might still want to consider the alternatives below, just to be sure. Simple high to low conversion: Voltage dividers The basic trick for lowering a voltage from, say 5V to 3.
To see how it works in reality, I made a voltage divider from two 10k resistors, and measured both the voltage on MCU pin itself the blue trace and from between the two resistors the red trace , when the MCU pin is set to alternate between low and high state times a second a kHz square wave : Such a setup works quite nicely for low frequencies and high impedance inputs i.
Also, no actual resistor is ideal, so even the resistors themselves have a tiny amount of capacitance. The input signal high level VIH can exceed the VDD supply voltage when these devices are used for logic level conversions.
So basically, you can power the with 3. After wiring the B to a breadboard, I plugged the ATtiny generating a kHz square wave into one of its inputs blue trace and measured the signal at the output red trace.
Note that both ATtiny and B are run from same voltage here, so no level shifting is actually done in this instance. The waveform looks very good with hardly any delay when compared to the original trace. This particular part sports dual outputs for each input — both the logical value and its complement are available. This time I wired the part to both 3. With B and my particular setup, the delay was ns nanoseconds — my Picoscope software allows me to measure that easily see the image.
Why is the propagation delay important? Consider a 1 MHz square wave. One waveform spends ns in high state and ns in low state — if this was a clock signal from 3.
With any additional delays e. With ns, this would mean a maximum communication frequency of about kHz. HCF B quad low to high voltage level shifter This part is very similar to the B, but the datasheet highlights a few key differences: Each buffer has a separate output enable pin that must be high to activate the output.
Also, this particular part can also work as high to low level shifter, as output supply voltage can be less than input supply voltage. It also means the one can connect the power supplies in either order, unlike with the B. So much like the previous part, it might be usable for 3. This way the output will sink current, something it should be better at of course, the LED will now light when output is LOW….
My testing also showed that in addition to the voltage characteristics, the propagation delay is a critical attribute to consider in any signalling applications above kHz. I hope you enjoyed the post. As always, feel free to suggest any new topics in the comments! Also interested in math, movies, anime, and the occasional slashdot now and then. Oh, and I also have a real life, but lets not talk about it! View all posts by Joonas Pihlajamaa Posted on.