FAST Framework

FAST Framework Driver

The FAST driver communicates with FAST Pinball controllers over USB serial using the FAST serial protocol. It targets FAST Neuron (platform code 2000) controllers at 921600 baud.

Protocol Overview

The FAST serial protocol uses CR-terminated ASCII messages with hex-encoded numeric values. Messages follow the framing pattern CMD:data\r:

Command Reference

PrefixNameDescription
IDBoard identificationReturns processor type, model, and firmware version
CHChannel setupConfigures platform code and switch reporting mode
WDWatchdogSets or expires the hardware watchdog timer
NNNode queryQueries I/O board information at a given node address
DLDriver configConfigures coil/driver outputs (modes: pulse, enable, hold, flipper, autofire)
TLTrigger configEnables or disables firmware-assisted trigger rules (flippers, autofire)
SLSwitch configConfigures individual switch inputs
SASwitch allReads initial states of all switches
RSRGB setSets a single LED color
RARGB allBatch LED color update
RFRGB fadeFades an LED to a target color
EMEnable motorEnables a servo motor channel
MPMotor positionSets a servo to a target position

Configuration

The FAST driver is configured in a platform block within your Cade configuration file.

platform "fast" "main" {
  net_port    = "/dev/ttyUSB0"
  exp_port    = "/dev/ttyUSB1"
  baud        = 921600
  platform    = "2000"
  watchdog_ms = 1000
}

Properties

PropertyTypeRequiredDefaultDescription
net_portstringYesSerial port for the NET processor
exp_portstringNo""Serial port for the EXP processor (optional second processor)
baudintNo921600Serial baud rate
platformstringNo"2000"FAST platform code ("2000" for Neuron)
watchdog_msintNo1000Hardware watchdog timeout in milliseconds. Set to 0 to disable.

Supported Capabilities

The FAST driver supports the full set of hardware capabilities:

Firmware-assisted flippers and autofire rules execute on the FAST controller, delivering sub-millisecond response times independent of the host.

Show Script Support

When a light show can be compiled into a FAST EXP script, the controller runs it directly on the hardware — eliminating tick-loop overhead and ensuring precise timing.

The show compiler translates Show definitions into EXP script strings with the following commands:

Script ElementFormatDescription
LED selector(03) or (03,04,05)Target LED index or group
Color_r=FF_g=00_b=00RGB hex values
On/Off+ / -Turn LED on or off
FadeF02Fade duration in FAST ticks (32ms each)
WaitW05Wait duration in FAST ticks
LoopL1 / J1Loop label and jump
Terminator.End of script

Scripts are limited to 128 characters. Shows that exceed firmware constraints (multiple LED groups, script too long) return errors and fall back gracefully to software-driven tick loops on the host.

Board Discovery

On startup, the driver discovers attached I/O boards by querying node addresses sequentially (NN:00, NN:01, …). Each response returns the board name, firmware version, driver (coil output) count, and switch input count. Discovery stops after three consecutive empty nodes.

Each discovered board reports information in the following format:

NN:<node_id>,<name>,<fw_version>,<driver_count>,<switch_count>,...

For example: NN:00,FP-I/O-3208-2,01.05,08,20,...

The total switch and driver counts across all discovered boards determine the platform capabilities reported to the rest of the system.

Connection Management

The driver manages one or two serial connections:

Command responses are matched to the sending command with a two-second timeout. Unsolicited switch notifications (-L: / /L:) and board boot status messages (!B:) arrive on separate channels, so a busy switch matrix cannot starve boot-status handling.

On connection open, the driver drains any stale data left in the serial buffer from a previous session so leftover responses cannot be misinterpreted.

Fire-and-forget commands (watchdog refresh, LED updates, servo positioning) do not block waiting for acknowledgment.

Initialization Sequence

The startup handshake follows a fixed sequence:

  1. ID: — identify the board model and firmware version.
  2. CH:2000,01 — configure for Neuron platform with verbose switch reporting.
  3. WD:0001 — expire the watchdog (clean slate).
  4. NN:00, NN:01, … — discover all attached I/O boards.

Once discovery completes, the driver reports the aggregate board capabilities and begins monitoring the watchdog, boot messages, and switch event stream.

Automatic Recovery

The driver handles board reboots automatically. A background boot message listener monitors for !B: messages:

Boot CodeMeaningDriver Action
0x00Power-up (board rebooting)Marks connection as disconnected, stops watchdog
0x02ReadyRe-runs the full initialization sequence, restarts watchdog
0xF0No applicationMarks connection as disconnected (fatal)
0xF1Corrupt headerMarks connection as disconnected (fatal)

When the board signals ready after a reboot, the driver re-runs the initialization sequence and resumes normal operation without requiring a restart of the host application.

Watchdog

When watchdog_ms is greater than zero, the driver runs a periodic watchdog refresh to keep the FAST controller active. If the host stops sending watchdog pings (e.g., due to a crash), the controller automatically disables all outputs to protect the hardware.