5.5.27 · D1 · HinglishEmbedded Systems & Real-Time Software

FoundationsSpaceWire — high-speed serial link standard for spacecraft

4,061 words18 min read↑ Read in English

5.5.27 · D1 · Coding › Embedded Systems & Real-Time Software › SpaceWire — high-speed serial link standard for spacecraft

Aap parent SpaceWire note padhne se pehle, har wo symbol apna banana padega jo wahan aata hai. Hum har ek ko scratch se banate hain, ek aisi order mein jahan har idea apne pehle wale idea pe lean karta hai.


1. "Bit" aur "bit period"

Ek light switch imagine karo. Off = 0, on = 1. Yahi poora alphabet hai jo ek wire samajhta hai.

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

Figure dekho: time left se right chalti hai, aur wire ka voltage ek line ke roop mein draw hai jo high (1) ya low (0) par baith ti hai. Har grey column ek bit period hai, apne value ke saath label kiya gaya. Ye picture woh stage hai jis par baaki sab kuch hota hai.


2. Serial vs parallel — ek wire kyun, aath kyun nahi

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

Figure mein, parallel bus (upar) ko 8 wires side by side chahiye; serial link (neeche) ko ek chahiye. Spacecraft par har wire mass (fuel cost) add karti hai aur har wire ek aur cheez hai jise cosmic ray corrupt kar sakti hai. Parallel wires mein bhi skew hoti hai: wire 3 wire 5 se thodi lambi ho sakti hai, toh unke bits thodi alag timing par arrive karte hain aur receiver ek garbled byte pakad leta hai.


3. Voltage, differential, aur LVDS

Ek wire ek voltage carry karti hai — ise paani ke pressure ki tarah socho. High pressure = 1, low = 0. Lekin space mein, radiation aur electrical noise ek single wire par extra "pressure" daalta hai aur reading flip kar deta hai.

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

Figure mein wire+ upar jaata hai jabki wire− neeche jaata hai. Unka difference (bottom trace) clean hai even after ek noise spike dono par aata hai. LVDS (Low Voltage Differential Signaling) woh specific low-power, low-voltage flavour hai jo SpaceWire use karta hai. "Low voltage" ka matlab hai chote swings → kam power (~10 mW per link), jo matter karta hai jab solar panels aapka sirf ek outlet hain.


4. XOR aur NOT — do logic gates jo tumhe zaroor pata hone chahiye

Parent note do symbols constantly use karta hai: aur overbar .

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

5. Parity — ek spare bit jo jhooth pakad ta hai


6. Data, Strobe, aur "har bit mein ek edge"

Ab SpaceWire ki do named wires.

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

Figure ko upar se neeche trace karo: Data unhi bit boundaries par change hoti hai jahan value change hoti hai; identical bits ki ek run par (Data ka flat stretch dekho), Strobe slack uthata hai aur balke toggle karta hai. Bottom trace (unka XOR) har column mein ek edge produce karta hai — wahi tumhara recovered clock hai.


6b. Receiver synchronization — startup par beat dhundhna

XOR ticks deta hai, lekin power-up par (ya ek glitch ke baad traffic rok deta hai) receiver ko un ticks par lock karna padta hai kisi bhi bit par trust karne se pehle.

Yahan startup sequence hai, step by step:

  1. Edges dekho. Bina traffic ke, dono lines idle hain. Pehli cheez jo receiver karta hai wo hai do lines par kisi bhi transition ko dekhna — har transition ek recovered-clock tick hai.
  2. Tick recover karo, phir middle tak delay karo. Ek transition ek bit boundary mark karta hai. Exactly boundary par sampling karna dangerous hai (value settle ho rahi hai), toh receiver har tick ke baad lagbhag half a bit period wait karta hai aur wahan Data sample karta hai — sabse safe, sabse stable point.
  3. Pehle NULLs bhejo (kabhi data nahi). Link start par, dono ends NULL control characters (Section 7 mein defined) ki ek stream transmit karte hain, real data nahi. NULLs ek fixed, known pattern hain, toh receiver confirm kar sakta hai "Main ek sensible, repeating pattern padh raha hun → mera sampling phase sahi hai" koi bhi payload flow hone se pehle.
  4. Handshake aur chalo. Jab ek baar har end achhe NULLs ki ek steady run dekhta hai (correct parity, expected bits), link khud ko connected declare karta hai, flow-control credit exchange hoti hai, aur real characters follow ho sakte hain. Ye staged start isliye hai ki SpaceWire safely hot-swappable hai — tum ek live cable plug kar sakte ho aur ye cleanly re-synchronize ho jaata hai.

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

Packets se pehle, SpaceWire bits ko characters mein group karta hai — sabse chota unit jo link actually frame aur send karta hai. Har character ek parity bit aur ek data-control flag bit se shuru hota hai jo batata hai kis tarah ka character ye hai.

Toh poora character alphabet hai: data bytes, FCT, EOP, EEP, ESC, aur NULL (= ESC+FCT-code). Control characters chote hain (parity + flag + 2 bits); data characters lambe hain (parity + flag + 8 bits).


8. Hops, latency, aur wormhole routing

Wormhole Routing vs Store-and-Forward mein compare karo. Payoff — kam, predictable delay — exactly wohi hai jo Real-Time Determinism demand karta hai.


9. Flow control, credit, FCT, aur RTT

Higher-level protocols jaise RMAP Protocol cargo ke andar sawaar hote hain — ye assume karte hain ki upar ka sab kuch pehle se kaam kar raha hai.


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

Right side cover karo aur zor se jawab do.

Bit rate kya hai, aur bit period kya hota hai?
har second mein bheje gaye bits ki count hai; bit period seconds hai — woh time jitna ek bit wire par occupy karta hai.
Symbol ka kya matlab hai?
Bit value (0 ya 1) jo bit period mein bheji gayi; pehla bit hai, doosra, aur aage aise.
SpaceWire ne parallel ki jagah serial kyun use kiya?
Kam mass, koi inter-wire skew nahi, kam failure points — ek wire faster kai wires ek saath se behtar hai.
Clock edge (tick) kya hai?
Wo instant jab signal low→high ya high→low change hota hai; receiver usi instant ka use karta hai ye decide karne ke liye kab bit padhni hai.
Differential/LVDS signaling kya defeat karta hai?
Common-mode noise (jaise radiation glitches) — wo dono wires par padhta hai aur difference mein cancel ho jaata hai.
kaunsa sawaal answer karta hai?
"Kya ye do bits alag hain?" — output 1 agar alag hain, 0 agar same hain.
Overbar kya karta hai?
Bit flip karta hai: , .
Byte 0xA7 ke liye, saate aath bits ka XOR kya hai?
(wahan paanch 1s hain, ek odd count).
given, even aur odd parity bits kya hain?
aur .
Simple parity kaun sa error FAIL karta hai detect karne mein?
Bit-flips ki koi bhi even count (jaise double error) — ones ki count unchanged hai toh parity theek lagti hai.
Transmitter Strobe kaise compute karta hai?
— Strobe tab toggle karo jab Data same rahi.
Strobe recurrence ke liye seed (initial condition) kya hai?
Pehle bit se pehle idle par, aur , toh well-defined hai.
Receiver clock kaise rebuild karta hai?
, har bit mein ek tick.
Receiver startup par sync kaise karta hai?
Ye edges watch karta hai, har tick ke baad ~half a bit period sample karta hai, aur koi bhi data flow hone se pehle known NULL characters ki stream par phase lock karta hai.
Data-control flag bit kya hai?
Ek leading bit: flag=0 matlab ek data character (8 payload bits follow hote hain); flag=1 matlab ek control character (2 control-code bits follow hote hain).
Control characters aur NULL ke naam batao.
FCT (code 00), EOP (01), EEP (10), ESC (11); NULL = ESC followed by FCT-code, idle ke roop mein bheja jaata hai.
EOP aur EEP mein fark kya hai?
EOP = packet ka normal end; EEP = packet ek error ki wajah se khatam hua.
Ek FCT kya grant karta hai?
8 data characters ke liye credit.
Link full rakhne ke liye kitna buffer chahiye ye kya set karta hai?
Round-trip time (RTT) — credit cable ke across wapas travel karni padti hai.
m/s par 10 m cable ka one-way delay?
ns (toh RTT ns).