5.5.27 · D1Embedded Systems & Real-Time Software

Foundations — SpaceWire — high-speed serial link standard for spacecraft

3,680 words17 min readBack to topic

Before you can read the parent SpaceWire note, you must own every symbol it throws at you. We build each from nothing, in an order where each idea leans on the one before it.


1. A "bit" and a "bit period"

Picture a light switch. Off = 0, on = 1. That's the whole alphabet a wire understands.

Figure — SpaceWire — high-speed serial link standard for spacecraft

Look at the figure: time runs left to right, and the wire's voltage is drawn as a line that sits high (1) or low (0). Each grey column is one bit period, labelled with its value. This picture is the stage on which everything else happens.


2. Serial vs parallel — why one wire, not eight

Figure — SpaceWire — high-speed serial link standard for spacecraft

In the figure, the parallel bus (top) needs 8 wires side by side; the serial link (bottom) needs one. On a spacecraft every wire adds mass (fuel cost) and every wire is another thing a cosmic ray can corrupt. Parallel wires also suffer skew: wire 3 might be a hair longer than wire 5, so their bits arrive at slightly different times and the receiver grabs a garbled byte.


3. Voltage, differential, and LVDS

A wire carries a voltage — think of it as water pressure. High pressure = 1, low = 0. But in space, radiation and electrical noise push extra "pressure" onto a single wire and flip the reading.

Figure — SpaceWire — high-speed serial link standard for spacecraft

The figure shows wire+ going up while wire− goes down. Their difference (bottom trace) is clean even after a noise spike lands on both. LVDS (Low Voltage Differential Signaling) is the specific low-power, low-voltage flavour SpaceWire uses. "Low voltage" means small swings → little power (~10 mW per link), which matters when solar panels are your only outlet.


4. XOR and NOT — the two logic gates you must know

The parent note uses two symbols constantly: and the overbar .

0 0 0
0 1 1
1 0 1
1 1 0

5. Parity — a spare bit that catches lies


6. Data, Strobe, and "one edge per bit"

Now the two named wires of SpaceWire.

Figure — SpaceWire — high-speed serial link standard for spacecraft

Trace the figure top to bottom: Data changes on the bit boundaries where the value changes; on a run of identical bits (see the flat stretch of Data), Strobe picks up the slack and toggles instead. The bottom trace (their XOR) produces one edge per column — that is your recovered clock.


6b. Receiver synchronization — finding the beat on startup

The XOR gives ticks, but on power-up (or after a glitch stops traffic) the receiver has to lock onto those ticks before it can trust any bit.

Here is the startup sequence, step by step:

  1. Watch for edges. With no traffic, both lines idle. The first thing the receiver does is watch the two lines for any transition — each transition is one recovered-clock tick.
  2. Recover the tick, then delay to the middle. A transition marks a bit boundary. Sampling exactly on a boundary is dangerous (value is settling), so the receiver waits about half a bit period after each tick and samples Data there — the safest, most stable point.
  3. Send NULLs first (never data). On link start, both ends transmit a stream of NULL control characters (defined in Section 7), not real data. NULLs are a fixed, known pattern, so the receiver can confirm "I am reading a sensible, repeating pattern → my sampling phase is correct" before any payload flows.
  4. Handshake and go. Once each end sees a steady run of good NULLs (correct parity, expected bits), the link declares itself connected, flow-control credit is exchanged, and real characters may follow. This staged start is why SpaceWire is safely hot-swappable — you can plug a live cable and it re-synchronizes cleanly.

7. Characters: NULL, FCT, EOP, EEP, and data

Before packets, SpaceWire groups bits into characters — the smallest unit the link actually frames and sends. Every character starts with a parity bit and a data-control flag bit that says which kind of character this is.

So the whole character alphabet is: data bytes, FCT, EOP, EEP, ESC, and NULL (= ESC+FCT-code). Control characters are short (parity + flag + 2 bits); data characters are long (parity + flag + 8 bits).


8. Hops, latency, and wormhole routing

Compare in Wormhole Routing vs Store-and-Forward. The payoff — low, predictable delay — is exactly what Real-Time Determinism demands.


9. Flow control, credit, FCT, and RTT

Higher-level protocols like RMAP Protocol ride inside the cargo — they assume all of the above already works.


Prerequisite map

bit and bit period bn

serial vs parallel

XOR and NOT

differential and LVDS

parity bit

Data-Strobe encoding

recovered clock

receiver sync NULL handshake

characters data FCT EOP EEP ESC NULL

packet address EOP EEP

wormhole routing

latency and hops

flow control credit FCT

round-trip time

SpaceWire link


Equipment checklist

Cover the right side and answer aloud.

What is the bit rate , and what is a bit period?
is the number of bits sent per second; the bit period is seconds — the time one bit occupies the wire.
What does the symbol mean?
The bit value (0 or 1) sent during bit period ; is the first bit, the second, and so on.
Why does SpaceWire use serial instead of parallel?
Less mass, no inter-wire skew, fewer failure points — one wire faster beats many wires at once.
What is a clock edge (tick)?
The instant a signal changes low→high or high→low; the receiver uses that instant to decide when to read the bit.
What does differential/LVDS signaling defeat?
Common-mode noise (e.g. radiation glitches) — it lands on both wires and cancels in the difference.
What question does answer?
"Are these two bits different?" — output 1 if they differ, 0 if same.
What does the overbar do?
Flips the bit: , .
For byte 0xA7, what is the XOR of all eight bits?
(there are five 1s, an odd count).
Given , what are the even and odd parity bits?
and .
What kind of error does simple parity FAIL to detect?
Any even number of bit-flips (e.g. a double error) — the count-of-ones is unchanged so parity looks fine.
How does the transmitter compute Strobe?
— toggle Strobe whenever Data stayed the same.
What is the seed (initial condition) for the Strobe recurrence?
At idle before the first bit, and , so is well-defined.
How does the receiver rebuild the clock?
, one tick per bit.
How does the receiver sync on startup?
It watches for edges, samples ~half a bit period after each tick, and locks phase on a stream of known NULL characters before any data flows.
What is the data-control flag bit?
A leading bit: flag=0 means a data character (8 payload bits follow); flag=1 means a control character (2 control-code bits follow).
Name the control characters and NULL.
FCT (code 00), EOP (01), EEP (10), ESC (11); NULL = ESC followed by FCT-code, sent as idle.
Difference between EOP and EEP?
EOP = normal end of packet; EEP = packet ended because of an error.
What does one FCT grant?
Credit for 8 data characters.
What sets how much buffer you need to keep the link full?
The round-trip time (RTT) — credit must travel back across the cable.
One-way delay of a 10 m cable at m/s?
ns (so RTT ns).