Tube ULA

Custom Acorn chip implementing the Tube — a fast (2 MHz clocked) communication channel between the BBC (“I/O processor”) and a second processor (“parasite”). The ULA sits on both sides of the Tube; each side sees its own copy at different SHEILA offsets.

Machine slotAddress range
Host (I/O processor)&FEE0-&FEE7
Parasite&FEF8-&FEFF

Register layout

Four 8-bit register pairs (status + data). Status and data of each register are at adjacent addresses:

RegisterHost statusHost dataParasite statusParasite dataPurpose
R1&FEE0&FEE1&FEF8&FEF9OSWRCH / events / ESCAPE
R2&FEE2&FEE3&FEFA&FEFBOther OS calls
R3&FEE4&FEE5&FEFC&FEFDData transfer / I/O errors
R4&FEE6&FEE7&FEFE&FEFFSystem control

Status register bits

R2, R3, R4 status:

BitMeaning
7DA — Data present (a byte is waiting to be read on this side)
6NF — Not Filled (transmit buffer has space)
5-0unused

R1 status carries the same DA/NF plus 6 control bits:

BitNameFunction
7DA1Data present in R1
6NF1R1 transmit not filled
5PParasite reset (active low)
4VEnable 2-byte FIFO on R3
3MEnable parasite NMI from R3 write
2JEnable parasite IRQ from R4 write
1IEnable parasite IRQ from R1 write
0QEnable host IRQ from R4 write

FIFO vs latch

  • R1, R2, R4 = single-byte latches. Write blocks until receiver reads.
  • R3 = FIFO. With V=1 (2-byte buffer), the host can queue multiple bytes for the parasite. R3 is the channel for bulk data transfers.

Interrupt sources

The Tube generates 3 IRQ types on each side, plus an NMI on the parasite:

SourceTriggers
R1 write to parasiteParasite IRQ (if I=1) — used for OSWRCH char, events, ESCAPE flag change
R3 writeParasite NMI (if M=1) — high-priority data transfer
R4 write to parasiteParasite IRQ (if J=1) — system control
R4 write to hostHost IRQ (if Q=1) — parasite initiated transaction

NMI on data transfer is what makes 2 MHz throughput possible: the parasite can be doing other work, and an NMI immediately yanks it to service the byte.

Hands off (mostly)

Direct Tube register pokes are dangerous. Writing arbitrary bytes triggers unserviceable interrupts on the other side → crash. Direct access is only appropriate when implementing a custom filing system or transfer protocol — see tube for the safe &406 entry point.

The one exception: during a bulk transfer initiated via &406, you do read/write &FEE5 directly (the R3 data register) to move bytes — but only after the transfer has been set up through &406 and with the prescribed inter-byte delays.

Hardware availability

MachineTube
Model BExternal (via Tube connector at rear)
B+External
Master 128External + internal co-processor socket (ITU bit in ACCCON selects)
Master CompactExternal (via cartridge port)
ElectronNo Tube (uses ULA pins differently)

The ACCCON ITU bit (shadow-ram) on Master selects internal vs external Tube.

See also

  • tube — Software protocol: claim/release, data transfer, OS dispatch.
  • memory-map — Tube range &FEE0-&FEFF in the SHEILA map.
  • shadow-ram — ACCCON ITU bit.
  • calls — OSWRCH / OSRDCH non-vectored variants (NVWRCH / NVRDCH) that don’t pass over Tube.

This wiki is curated by Claude following the LLM-Wiki methodology — a human curates source documents, the LLM compiles structured cross-linked markdown. Content may contain errors, omissions, or stale claims. For authoritative information refer to the original source documents in the bbc-documents GitHub archive.