The rising edge
A LOW crosses the TK97 at once. A HIGH crosses in two parts: the transistor carries the far side up to about 2 V, and then a 10 kΩ resistor has to fill the wire the rest of the way. That last part sets the speed: serial and I2C have time to spare, SPI is fine at a few MHz on short wires, and faster than that it is a gamble.
Down is fast, up comes in two parts
A LOW is always something pulling hard to ground: your pin, the part's pin, or the switched-on transistor. It crosses in nanoseconds.
A HIGH is different. When the driving side rises, the transistor stays on until the far side is about 3.3 V less its threshold, a little over 2 V, and carries the far side up that far almost as fast as the driver. Then it switches off, and the far side's own 10 kΩ has to fill the wire the rest of the way.
Where the receiver calls it HIGH decides how much is left for the resistor. A 3.3 V part calls it HIGH from about 2.3 V, just past the transistor's head start. A 5 V Uno wants 3 V, well past it. So a signal from the Uno to a 3.3 V display rises faster than the same wire the other way.
The threshold is the soft number. KUU's data sheet gives 0.8 to 1.6 V and no typical value; the figure uses the middle, and a board with a low threshold does better, one with a high threshold worse.
Where the line falls
With short jumpers, a rise is "fine" here when it takes under half the shortest HIGH:
| Signal | Shortest HIGH | 5 V side drives | 3.3 V side drives |
|---|---|---|---|
| Serial at 115200 | 8.7 µs | fine | fine |
| I2C at 100 kHz | 5 µs | fine | fine |
| I2C at 400 kHz | 1.25 µs | fine | fine |
| SPI at 1 MHz | 0.5 µs | fine | fine |
| SPI at 4 MHz | 125 ns | fine | marginal |
| SPI at 8 MHz | 62.5 ns | marginal | too slow |
The wire figures are the llc book's round numbers, not measurements, and the table is a guide to where to look first, not a promise.
Buying time
- Shorter wires. Less to fill. On a LEGO base with a block plugged straight into the socket, the 3.3 V side's wire is almost nothing.
- A slower clock. Most SPI libraries let you set it. An I2C bus at 100 kHz has plenty of time.
- The part's own pull-ups. Many I2C blocks have them, alongside the board's 10 kΩ, and more pull-up fills the wire faster.
For a signal that must be fast in the 3.3 V to 5 V direction, the TXB0108 board in the llc book pushes its edges rather than pulling them up; TXB and TXS is the place to read about it.
When it does not work
The HIGHs got shorter than the time the 10 kΩ needs to lift the wire. Slow the clock, for example to 4 MHz, and shorten the wires. For a TK89 display through the TK97, the TK89 book uses tft.setSPISpeed(4000000).
More wire, more to fill, slower HIGHs. Something that fitted on short jumpers can fail at 30 cm. Shorten the run, or slow the signal.
No. A falling edge is a pin, or the transistor, pulling hard to ground, and it is fast in both directions. Only the rising edge depends on the resistors.
The llc book counts the resistor doing the whole rise from 0 V, which is the faint curve in the figure. The transistor gives the far side a head start to about 2 V, so the resistor has less to do. Both are rough; neither is a measurement.
An Uno on the header, a TK42 in the socket, and an I2C scan to prove it.
A 5 V board and a 3.3 V block →Edit this page — content/books/logic-level-converter/the-rising-edge.mdx
Questions about this product
See what other owners have asked, and read their solutions.
Logic Level Converter
Loading discussions…
Discuss this article
Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.