49в. Waves and transmission lines: signal speed, when a trace becomes a line, reflections, termination, radiation
In section 49а a trace got capacitance per unit length, in 49б — inductance per unit length. Here they meet: if every centimetre of a trace has both L and C, a signal travels along it as a wave with a finite speed, the trace gets a characteristic impedance, and the wave reflects from an unmatched end. This is where ringing on a clock input, the 22–33 Ω resistor at an SPI pin and board radiation come from. Every formula comes with a calculation on board values: an FR-4 trace, an STM32 pin edge from the datasheet, a 5 pF input.
Section 160 already treats long lines in practice — the IPC-2141 formula, two ngspice models, the I²C edge. Here is the physics underneath: where the speed and Z0 come from, how reflections add up step by step, why a chip input is not a matched load, what each termination costs in milliwatts and how an edge turns into radiation.
Basis: constants are CODATA 2022 from scipy.constants (scipy 1.18.1,
numpy 2.3.3, image stm-ml:1). FR-4 permittivity is 4.5, as in 49а and
160.2 (no laminate datasheet on disk). Pin edges come from datasheets in
the Keil packs: DS12589 Rev 4 (STM32G431), table 55 on p. 114, and
DocID13587 Rev 17 (STM32F103), table 37 on p. 66; input capacitance 5 pF —
DS12589, p. 111. The microstrip uses the Hammerstad formulas (as in 49а and
49б); the line in time is solved with travelling waves in Python (script
calc49c.py) and with the T line model in ngspice 39 (image stm-lab:1,
file lines49c.cir). No hardware measurements.
What the documentation calls it
Original Meaning propagation velocity, propagation delay how fast and how late the wave arrives effective permittivity (εeff) permittivity seen by a trace half in air rise / fall time (tr, tf) edge duration I/O speed (OSPEEDR, MODEx) pin slew setting transmission line, characteristic impedance (Z0) line, V/I ratio of a travelling wave reflection coefficient (Γ) share of the wave sent back bounce (lattice) diagram step-by-step picture of reflections ringing, overshoot, undershoot oscillation around the final level series / parallel / AC (RC) termination ways to absorb the wave differential pair, differential impedance two opposite traces, impedance between them radiated emission, loop antenna the board as a transmitter trapezoidal spectrum, envelope harmonics of a square wave with edges
49в.1 Signal speed and edge length
An electromagnetic wave in vacuum travels at the speed of light —
300 mm/ns. In a dielectric it is √εr times slower: in solid FR-4 with
εr = 4.5 — 141 mm/ns. On a surface trace part of the field runs in air,
so the speed is set by the effective permittivity εeff — somewhere
between 1 and 4.5:
v = c / √εeff
| 0.25 mm trace | εeff | Speed | Delay |
|---|---|---|---|
| over ground 1.5 mm (two-layer board) | 3.00 | 173 mm/ns | 5.78 ps/mm |
| over ground 0.2 mm (four-layer) | 3.29 | 165 mm/ns | 6.05 ps/mm |
About 6 ps per millimetre is the easiest thing to remember. Section 160.1 gives 6.14 ps/mm for a 50 Ω trace by IPC-2141 — the same order.
Edge length. While the pin switches over time tr, the start of the
edge runs ahead by tr·v. If the trace is shorter than one sixth of that
length, reflections die out inside the edge and the trace can be treated
as a plain wire with capacitance (section 160.1). Longer — it is a line.
Pin edges come from the datasheets. On G431 the speed is set by the
OSPEEDR bits (table 55, p. 114, 10 pF load, 2.7–3.6 V supply), on F103
by the MODE bits (table 37, p. 66, 50 pF load, the fastest one — 30 pF).
Speed — 173 mm/ns:
| Pin | Edge | Edge length | Line if longer than |
|---|---|---|---|
G431, OSPEEDR = 00 (low) |
17 ns | 294 cm | 49.0 cm |
G431, OSPEEDR = 01 (medium) |
4.5 ns | 77.8 cm | 13.0 cm |
G431, OSPEEDR = 10 (high) |
2.5 ns | 43.2 cm | 7.21 cm |
G431, OSPEEDR = 11 (very high) |
1.7 ns | 29.4 cm | 4.90 cm |
F103, MODE = 10 (2 MHz) |
125 ns | 2162 cm | 360 cm |
F103, MODE = 01 (10 MHz) |
25 ns | 432 cm | 72.1 cm |
F103, MODE = 11 (50 MHz) |
5 ns | 86.5 cm | 14.4 cm |
The datasheet gives maximum times at a given load; the real edge on a light load can be faster, so the limit in the table is an upper estimate. Conclusion: a G431 pin at the highest speed turns a five-centimetre trace into a line. The same pin at low speed is fine over half a metre. F103 at 2 MHz does not make a line even of a three-metre wire — its edge is slow by itself.
What to do on the board: pin speed — the minimum that is enough. For an LED and a button — low, for SPI at 10 MHz medium is enough; very high only where timing cannot be met without it (section 08 — registers, 203.2 — what it means for emissions).
49в.2 Characteristic impedance: L and C per centimetre
A wave travelling along a line carries voltage and current in a fixed ratio. Each new centimetre of trace at the edge has to be charged (C) and have current started in it (L) — hence
Z0 = √(L / C), v = 1 / √(L·C)
where L and C are per unit length. Z0 is not the resistance of a piece of wire: an ohmmeter shows fractions of an ohm. It is the ratio of voltage to current in a travelling wave until the wave reaches the end.
The per-unit-length values are already known: the capacitance of a 0.25 mm trace — in 49а.4 by a field calculation on a grid (0.440 pF/cm over ground 1.5 mm and 0.981 pF/cm over 0.2 mm), the inductance — in 49б.2 (7.75 and 3.81 nH/cm):
for h in (1.5, 0.2):
Lc, Cc = L49B[h], C49A[h]
z = math.sqrt(Lc / Cc)
v = 1 / math.sqrt(Lc * Cc) * 1e-2 # см/с → м/с
| 0.25 mm trace | Z0 from L and C | v from L and C | Z0 by Hammerstad |
|---|---|---|---|
| over ground 1.5 mm | 133 Ω | 171 mm/ns | 134 Ω |
| over ground 0.2 mm | 62.3 Ω | 164 mm/ns | 62.9 Ω |
The difference is −1.0 %: the grid field in 49а gave capacitance 2 % above the formula, and Z0 depends on the square root of C. Two different roads — the field in the cross-section and a ready formula — lead to the same Z0.
What the numbers show. An ordinary signal trace on a two-layer board is about 130 Ω; on a four-layer board the same width is about 60. For 50 Ω the Hammerstad formula needs 2.84 mm width over 1.5 mm and 0.379 mm over 0.2 mm (IPC-2141 in 160.2 gives 2.729 and 0.326 mm — different formulas, same order). Z0 grows with height over ground (less C, more L) and falls with width. Trace length does not affect Z0 — only the delay.
49в.3 Reflection and the bounce diagram
The wave reaches the end of the line where the load ZL sits. Ohm's law at
the end requires V/I = ZL, while in the wave V/I = Z0. If they differ,
a reflected wave is born with the share
Γ = (ZL − Z0) / (ZL + Z0)
Γ = 0 — matched, the wave is absorbed; Γ = +1 — open circuit, the wave returns entirely and the voltage at the end doubles; Γ = −1 — short. For a 62.9 Ω line:
| Load | Γ |
|---|---|
| CMOS input, 1 MΩ | 1.000 |
| 100 Ω resistor | 0.228 |
| 50 Ω resistor | −0.114 |
| 25 Ω pin output (seen from the line) | −0.431 |
A microcontroller input is not megaohms but a 5 pF capacitance. For a capacitance the magnitude of Γ is always 1 — it absorbs no energy, it only shifts the phase of the reflected wave: −2° at 10 MHz, −22° at 100 MHz, −126° at 1 GHz. So a chip input at the end of a trace always reflects and cannot be matched "at the end" without a resistor.
Pin output resistance. Datasheets do not give it directly, but they give the drop: no more than 0.4 V at 8 mA (F103 — DocID13587, p. 65, table 36; G431 — DS12589, p. 113, table 54). So the low-side switch is no more than 50 Ω; at fast settings the real output is lower. The calculation uses 25 Ω, as section 160.3 does; the exact value is not on disk.
Bounce diagram. A 3.3 V source with a 25 Ω output, a 62.9 Ω line, open end, instant edge. The divider share goes into the line: 3.3 × 62.9 / (25 + 62.9) = 2.36 V. Then the wave runs back and forth, reflecting with Γ = 1 at the end and Γ = −0.431 at the source:
| Arrival at the end | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| voltage at the end, V | 4.72 | 2.69 | 3.56 | 3.19 | 3.35 |
At the source — 2.36 V, then 3.70; 3.13; 3.38; 3.27 V. Every round trip multiplies the error by 0.431 and flips its sign: the ringing converges to 3.3 V. An output below Z0 (Γ < 0) gives alternating ringing; an output above Z0 (Γ > 0) gives a slow staircase rise without overshoot.
49в.4 Ringing at the end of a trace: Python and ngspice
A model closer to the board. A G431 pin at the highest speed: a 1.7 ns edge (linear, 0–100 %), 3.3 V, 10 MHz, 25 Ω output. A 0.25 mm trace over ground 0.2 mm, 15 cm long: Z0 62.9 Ω, delay 907 ps. At the end — a 5 pF input. For such an edge anything longer than 4.68 cm is a line, so 15 cm is three times over the limit. The round trip is 1.81 ns, longer than the edge itself.
Python solves the line with travelling waves: a wave goes into the line,
after 907 ps it meets the load at the end, the reflected one goes back;
the end nodes use implicit Euler with a 1 ps step. ngspice takes the same
circuits with an ideal T line. Peaks, settled levels and power agree to
the third digit.
| Case | Peak at input | Dip after peak | Inside ±5 % after | Power from supply |
|---|---|---|---|---|
| no termination | 4.66 V | 2.74 V | 8.9 ns | 2.11 mW |
| 33 Ω at the pin | 3.40 V | 3.30 V | 2.8 ns | 2.11 mW |
| 62 Ω at the end to ground | 2.44 V | 2.34 V | 2.7 ns | 61.8 mW |
| RC at the end: 62 Ω + 100 pF | 3.30 V | 3.30 V | 14 ns | 12.9 mW |
| no termination, 17 ns edge | 3.41 V | 3.26 V | 17 ns | 2.11 mW |
Time to the band is counted from the start of the edge at the pin. Without termination the input sees 4.66 V on a 3.3 V supply: the input protection diodes open and push current into the supply (they are not in the model — with them the peak would be lower and the current would go into the supply rail). The dip to 2.74 V is near the high-level threshold; on a clock input such ringing is an extra edge. The ringing period of 4.82 ns is longer than four delays (3.63 ns): the input capacitance slows the reflection.
The same pin at low speed (17 ns edge) on the same trace gives only 3.41 V: for a 17 ns edge the line limit is 46.8 cm, and 15 cm is no longer a line. The cheapest termination is to lower the pin speed.
49в.5 Termination: what each one costs
Series — a resistor at the source. The source plus the resistor must
equal Z0. Then the wave returning from the open end is not reflected
again at the source. Half goes into the line — 1.72 V (the shelf in the
figure), at the open end it doubles to the supply level. Choosing
R = Z0 − Rout:
| Pin output | R for 62.9 Ω |
|---|---|
| 15 Ω | 48 Ω |
| 25 Ω | 38 Ω |
| 35 Ω | 28 Ω |
Hence the usual 22–33 Ω: board traces are 50–65 Ω, a pin output is on the order of 20–35 Ω, and nobody knows it more precisely. A resistor a bit below the calculated one (33 Ω instead of 38) gives a small overshoot — 3.40 V in the table — but does not slow the edge. It is placed right at the pin, otherwise the piece of line before the resistor stays unmatched. Power is the same as without termination: 2.11 mW, this is charging the trace and input capacitance, C·V²·f with the capacitance from 49а — 2.15 mW. Limitation: one receiver and only at the end — in the middle of the line the level sits at half (section 160.4).
Parallel — a resistor at the end. 62 Ω to ground absorbs the wave but forms a divider with the 25 Ω output: a one becomes 2.35 V instead of 3.3 V, and a DC current flows while high — 62.6 mW per pin at 50 % duty. This is not how a microcontroller pin is terminated (section 160.4); it is a solution for buses with differential receivers and strong drivers.
RC at the end. The same resistor through a 100 pF capacitor: at the
edge the network absorbs the wave, there is no DC current. The price is
recharging the capacitor every period: C·V²·f = 10.9 mW on top of 2.11 —
12.9 mW in total. The capacitor with the resistor also lengthens settling
(14 ns in the table). The capacitor is chosen so that R·C exceeds the
line round trip, but no more than the period allows.
Bottom line for a microcontroller: on clock and SPI lines longer than the
limit from 49в.1 — a 22–33 Ω resistor at the pin; if speed is not needed —
lower OSPEEDR; parallel and RC — for buses and receivers that need them.
49в.6 Differential pairs and radiation
A differential pair is two traces carrying opposite signals. The current of one returns through the other, the field of the pair is concentrated between them, and what matters is the impedance "between the wires" — the differential one. USB — 90 Ω (how to get it with width and gap — section 132г.4, the interface itself — section 20), CAN — a 120 Ω twisted pair with a 120 Ω resistor at each end (section 19.2) — the same parallel termination as in 49в.5, but for a bus whose driver is designed for such a load. External noise appears almost equally on both wires, and the receiver looks at the difference.
Radiation. The pin current goes out along the trace and returns through ground — a loop, that is a loop antenna. A small loop of area A with current I at frequency f gives in the far field at distance r
E = η0·π·A·I·f² / (c²·r)
η0 = 376.73 Ω — the impedance of free space; the factor
η0·π/c² = 1.317·10⁻¹⁴. A 1 cm² loop with 1 mA at 100 MHz gives
4.39 µV/m at 3 m. The field grows as frequency squared — double the
frequency, 4.00 times the field, +40 dB per decade.
Spectrum of edges. A 10 MHz square wave with edges is a trapezoid. Its
harmonics are odd, the envelope is flat up to 1/(π·τ) = 6.37 MHz (τ —
pulse width, 50 ns), then falls at −20 dB per decade, and after
1/(π·tr) at −40 dB per decade. The corner depends only on the edge:
187 MHz for a 1.7 ns edge and 18.7 MHz for 17 ns. Harmonic amplitudes of
a 3.3 V square wave (the formula and the fast Fourier transform differ by
0.00 %):
| Harmonic | Frequency | 1.7 ns edge | 17 ns edge |
|---|---|---|---|
| 1 | 10 MHz | 2100 mV | 2002 mV |
| 3 | 30 MHz | 697 mV | 437 mV |
| 9 | 90 MHz | 225 mV | 48.3 mV |
| 31 | 310 MHz | 40.8 mV | 3.07 mV |
| 99 | 990 MHz | 3.37 mV | 0.204 mV |
Multiply: the harmonic current is the voltage divided by the 25 Ω output plus the line Z0 (while the wave runs, the pin sees Z0), the field — by the loop formula. The +40 dB/dec field growth and the −20 dB/dec spectrum fall give +20 dB/dec up to the edge corner and a flat shelf above it. Field at 3 m from a 15 cm trace, µV/m:
| Harmonic | Return via ground 0.2 mm (0.300 cm²) | Ground 1.5 mm (2.25 cm²) | Return 10 mm aside (15.0 cm²) |
|---|---|---|---|
| 1, 1.7 ns edge | 0.315 | 2.36 | 15.7 |
| 9, 1.7 ns edge | 2.72 | 20.4 | 136 |
| 31, 1.7 ns edge | 5.87 | 44.0 | 294 |
| 9, 17 ns edge | 0.587 | 4.40 | 29.3 |
| 31, 17 ns edge | 0.442 | 3.32 | 22.1 |
Two levers are obvious. Loop area: a solid ground right under the trace (section 130.2) makes the loop 50 times smaller than a return one centimetre aside — and the field just as much weaker. Edge: at the 31st harmonic a slow pin radiates 13 times less than a fast one.
This is the radiation of the board itself. Cables radiate more — common mode current and a quarter-wave antenna; estimates and the order of the allowed field (tens of µV/m at 3 m) — section 203.2, layout rules — sections 130 and 132г.
49в.7 Pitfalls
A clock input counts extra edges. Ringing of an unmatched line
crosses the threshold: in the model the dip after the peak goes down to
2.74 V. A 33 Ω resistor at the pin or a lower OSPEEDR speed.
The input is above the supply, the chip warms up, the ADC nearby is noisy. Reflection at the input doubles the wave: 4.66 V on 3.3 V. The current goes through the protection diodes into the supply rail.
"Terminated" with a resistor at the end — a one is not read. A divider with the pin output: 2.35 V and 62.6 mW per pin (section 160.4).
The 33 Ω resistor sits at the receiver, not at the pin. Then it does not match the source: the line between the pin and the resistor rings as before.
A series resistor and two receivers on one line. The first receiver in the middle sees the 1.72 V shelf while the wave travels.
A "50 Ω" trace made 0.25 mm wide on a two-layer board. Over 1.5 mm it is 133–134 Ω; 50 Ω there needs almost 3 mm width.
Very high speed "just in case". The line limit is 4.90 cm instead of 49.0 cm, the 310 MHz harmonic is 13 times stronger. Pin speed — the minimum that is enough.
A ground split under a fast trace. The return goes around, the loop grows — in the radiation table that is moving from the first column to the third (section 130.2).
49в.8 Summary
- Speed along an FR-4 trace: 173 mm/ns over 1.5 mm and 165 mm/ns over 0.2 mm (εeff 3.00 and 3.29), about 6 ps/mm; in vacuum — 300 mm/ns.
- A trace is a line if longer than 1/6 of the edge: G431 very high (1.7 ns) — from 4.90 cm, low (17 ns) — from 49.0 cm; F103 at 50 MHz (5 ns) — from 14.4 cm.
Z0 = √(L/C)from 49а and 49б: 133 Ω over 1.5 mm and 62.3 Ω over 0.2 mm; the Hammerstad formula — 134 and 62.9 Ω (−1.0 %).Γ = (ZL − Z0)/(ZL + Z0): a 5 pF input reflects fully (|Γ| = 1.000), a 25 Ω output — −0.431; without termination 4.72 V at the end after the first pass.- Ringing on 15 cm with a 1.7 ns edge: peak 4.66 V, dip 2.74 V, ±5 % after 8.9 ns; with 33 Ω at the pin — 3.40 V and 2.8 ns; Python and ngspice agree.
- Cost of termination: series — 2.11 mW, same as without; parallel 62 Ω — 61.8 mW and a one at 2.35 V; RC — 12.9 mW.
- Loop radiation grows as f²; the edge spectrum bends at 6.37 MHz and
1/(π·tr); a 0.300 cm² loop against 15.0 cm² — a 50 times weaker field.
Next: section 49г "Noise: thermal, shot, 1/f, interference — where it comes from and what limit it sets for the ADC and the amplifier" — the fourth section of the series "Physics for the developer": where thermal, shot and 1/f noise come from, how to describe noise with a number in a bandwidth, when it shows against the step of a 12-bit ADC, why averaging does not always help and how the spectrum tells interference from noise.