FAST Framework

driver fast hardware

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:

  • A two-character command prefix, followed by a colon, comma-separated hex data fields, and a carriage return terminator.
  • Responses indicate success with XX:P (pass), failure with XX:F (fail), or invalidity with XX:X.
  • Asynchronous messages arrive unsolicited: -L:<hex> for switch closed, /L:<hex> for switch opened, and !B:<code> for board boot status.

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: manual, pulse, latch, flipper, autofire)
TLTrigger configEnables or disables firmware-assisted trigger rules (flippers, autofire), and disables a coil
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
ESEXP show writeWrites a light show script into controller RAM
TSEXP show triggerTriggers a stored show by slot number
EWEXP show persistPersists stored shows to controller flash

The ES, TS, and EW commands travel over the EXP port, so hardware-resident light shows require exp_port to be configured.

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:

  • Switch inputs — monitored over SL: / SA: configuration and -L: / /L: asynchronous events.
  • Coils — pulse (DL: mode 01) and hold/enable (DL: mode 02, a latch). Coils are configured for manual triggering (mode 00) by default and switched off with TL:.
  • RGB LEDs — individual and batched colour updates via RS:, RA:, and RF: (fade).
  • Firmware-assisted flippers — configured through DL: (mode 10) and toggled with TL:.
  • Firmware-assisted autofire rules — bumpers, slingshots, and other rule-driven coils via DL: (mode 11) and TL:.
  • Servo motors — enabled with EM: and positioned with MP:.
  • Firmware-assisted light shows — compiled to EXP scripts and executed directly on the controller. Requires exp_port.

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

Platform Capabilities

CapabilityValue
Transportserial
Max switchesSum of the switch counts across discovered boards
Max coilsSum of the driver counts across discovered boards
Max lightsThree per available coil
RGB lightsYes
PWM coilsYes
Firmware flippersYes
Firmware autofireYes
Firmware showsYes, when exp_port is set
Max show slots32
Max show script length128 characters
Address formatboard-port

Switch, coil, and light maxima are not fixed — Cade reports them after board discovery finishes, so they reflect the boards actually attached to your machine. The firmware version and hardware revision reported alongside them come from the controller’s own identification response.

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.

Light shows are translated into EXP script strings built from these elements:

Script ElementFormatDescription
LED selector(03) or (03,04,05)Target LED index or group, zero-padded to two digits
Color_r=ff_g=00_b=00RGB values as lowercase hex
On/Off+ / -Turn LED on or off
FadeF0aFade duration, as a two-digit hex count of FAST ticks
WaitW10Wait duration, as a two-digit hex count of FAST ticks
LoopL1 / J1Loop label and jump
Terminator.End of script

One FAST tick is 32ms, and tick counts are clamped to the range 1–255, so a single fade or wait step tops out at roughly eight seconds.

Scripts are limited to 128 characters. Shows that exceed firmware constraints (multiple LED groups, script too long) are not offloaded — Cade logs the reason and runs the show from the host instead. This fallback is silent from a gameplay perspective: the show still plays, just driven by the host rather than the controller.

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. An address with no board answers with the name !Node Not Found!; discovery stops after three consecutive misses.

Each discovered board reports eleven comma-separated fields, the first five of which are the ones you will care about:

NN:<node_id>,<name>,<fw_version>,<driver_count>,<switch_count>,<6 further fields>

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:

  • NET connection (required) — the primary link to the NET processor. Carries all command/response traffic, switch events, and boot messages.
  • EXP connection (optional) — a secondary link to the EXP processor for expanded I/O, configured via exp_port.

Commands that expect a reply wait up to two seconds for it; a slower response is reported as a timeout in the logs. Unsolicited switch notifications (-L: / /L:) and board boot status messages (!B:) are handled independently of that exchange, so heavy switch traffic does not delay reboot detection.

On connection open, the driver discards any stale data left in the serial buffer from a previous session, so leftover responses cannot be misread as answers to new commands.

High-rate commands — watchdog refreshes, LED updates, and servo positioning — are sent without waiting for acknowledgment, which is why a failed LED write does not surface as an error the way a failed configuration command does.

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.

Troubleshooting

SymptomLikely causeWhat to try
Cade fails to open the serial port at startupWrong net_port path, the device is unplugged, or your user lacks permission to the portConfirm the port path (/dev/ttyUSB0, /dev/ttyACM0, or a COM port on Windows), reseat the USB cable, and add your user to the dialout group on Linux.
Startup logs report no response from the board within the timeoutThe controller is still booting, powered off, or baud does not match the boardPower-cycle the controller, verify it has power, and leave baud at the default 921600 unless your hardware requires otherwise.
Startup reports the board is not readyThe board was queried before its firmware finished bootingWait a few seconds and let Cade retry, or power-cycle the controller.
Outputs suddenly go dead during play, and logs show a failed watchdog refreshThe host stopped sending watchdog pings (a stall or crash), so the controller disabled all outputs to protect the hardwareRestart Cade. If it recurs, raise watchdog_ms to give the host more headroom, or set it to 0 to disable the watchdog while diagnosing.
Logs show repeated board reboot (boot) messagesThe controller is resetting, often from a power or cabling problemCheck the power supply and USB cabling. The driver re-runs its startup sequence automatically after each reboot, so occasional recovery is normal, but repeated reboots point to a hardware issue.
Logs report the board has no application or a corrupt firmware imageThe controller firmware is missing or damagedReflash the controller firmware with FAST’s tools, then restart Cade.
Fewer boards are discovered than expectedAn I/O board is unpowered or its node cabling is looseCheck power and the node cabling between boards; the discovered board names, firmware versions, and switch/driver counts are printed in the startup logs.