How it works · 06 of 9

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.

The rising edge
Who drives
Wire
Reads HIGH after
48 ns
Clock that fits
5.2 MHz
Threshold assumed
1.2 V
When the 5 V side drives and a 3.3 V part listens, the transistor carries the edge to 2.1 V at once, and the 10 kΩ only has to find the last 0.21 V: HIGH in about 48 ns. A clock of about 5.2 MHz still gets through, so an SPI display at 4 MHz is fine on short wires.

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:

SignalShortest HIGH5 V side drives3.3 V side drives
Serial at 1152008.7 µsfinefine
I2C at 100 kHz5 µsfinefine
I2C at 400 kHz1.25 µsfinefine
SPI at 1 MHz0.5 µsfinefine
SPI at 4 MHz125 nsfinemarginal
SPI at 8 MHz62.5 nsmarginaltoo 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

SPI works at a slow clock and fails at a fast one.

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).

It worked on the bench and failed with longer wires.

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.

Is the falling edge slow too?

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.

Why is the book's table kinder than the llc book's?

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.

Where this goes next

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

Community

Questions about this product

See what other owners have asked, and read their solutions.

Ask a question ↗

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.

Browse Modules and blocks on the forum →