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:
- 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 withXX:F(fail), or invalidity withXX:X. - Asynchronous messages arrive unsolicited:
-L:<hex>for switch closed,/L:<hex>for switch opened, and!B:<code>for board boot status.
Command Reference
| Prefix | Name | Description |
|---|---|---|
ID | Board identification | Returns processor type, model, and firmware version |
CH | Channel setup | Configures platform code and switch reporting mode |
WD | Watchdog | Sets or expires the hardware watchdog timer |
NN | Node query | Queries I/O board information at a given node address |
DL | Driver config | Configures coil/driver outputs (modes: manual, pulse, latch, flipper, autofire) |
TL | Trigger config | Enables or disables firmware-assisted trigger rules (flippers, autofire), and disables a coil |
SL | Switch config | Configures individual switch inputs |
SA | Switch all | Reads initial states of all switches |
RS | RGB set | Sets a single LED color |
RA | RGB all | Batch LED color update |
RF | RGB fade | Fades an LED to a target color |
EM | Enable motor | Enables a servo motor channel |
MP | Motor position | Sets a servo to a target position |
ES | EXP show write | Writes a light show script into controller RAM |
TS | EXP show trigger | Triggers a stored show by slot number |
EW | EXP show persist | Persists 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
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
net_port | string | Yes | – | Serial port for the NET processor |
exp_port | string | No | "" | Serial port for the EXP processor (optional second processor) |
baud | int | No | 921600 | Serial baud rate |
platform | string | No | "2000" | FAST platform code ("2000" for Neuron) |
watchdog_ms | int | No | 1000 | Hardware 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 withTL:. - RGB LEDs — individual and batched colour updates via
RS:,RA:, andRF:(fade). - Firmware-assisted flippers — configured through
DL:(mode 10) and toggled withTL:. - Firmware-assisted autofire rules — bumpers, slingshots, and other rule-driven coils via
DL:(mode 11) andTL:. - Servo motors — enabled with
EM:and positioned withMP:. - 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
| Capability | Value |
|---|---|
| Transport | serial |
| Max switches | Sum of the switch counts across discovered boards |
| Max coils | Sum of the driver counts across discovered boards |
| Max lights | Three per available coil |
| RGB lights | Yes |
| PWM coils | Yes |
| Firmware flippers | Yes |
| Firmware autofire | Yes |
| Firmware shows | Yes, when exp_port is set |
| Max show slots | 32 |
| Max show script length | 128 characters |
| Address format | board-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 Element | Format | Description |
|---|---|---|
| LED selector | (03) or (03,04,05) | Target LED index or group, zero-padded to two digits |
| Color | _r=ff_g=00_b=00 | RGB values as lowercase hex |
| On/Off | + / - | Turn LED on or off |
| Fade | F0a | Fade duration, as a two-digit hex count of FAST ticks |
| Wait | W10 | Wait duration, as a two-digit hex count of FAST ticks |
| Loop | L1 / J1 | Loop 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:
- ID: — identify the board model and firmware version.
- CH:2000,01 — configure for Neuron platform with verbose switch reporting.
- WD:0001 — expire the watchdog (clean slate).
- 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 Code | Meaning | Driver Action |
|---|---|---|
0x00 | Power-up (board rebooting) | Marks connection as disconnected, stops watchdog |
0x02 | Ready | Re-runs the full initialization sequence, restarts watchdog |
0xF0 | No application | Marks connection as disconnected (fatal) |
0xF1 | Corrupt header | Marks 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
| Symptom | Likely cause | What to try |
|---|---|---|
| Cade fails to open the serial port at startup | Wrong net_port path, the device is unplugged, or your user lacks permission to the port | Confirm 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 timeout | The controller is still booting, powered off, or baud does not match the board | Power-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 ready | The board was queried before its firmware finished booting | Wait a few seconds and let Cade retry, or power-cycle the controller. |
| Outputs suddenly go dead during play, and logs show a failed watchdog refresh | The host stopped sending watchdog pings (a stall or crash), so the controller disabled all outputs to protect the hardware | Restart 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) messages | The controller is resetting, often from a power or cabling problem | Check 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 image | The controller firmware is missing or damaged | Reflash the controller firmware with FAST’s tools, then restart Cade. |
| Fewer boards are discovered than expected | An I/O board is unpowered or its node cabling is loose | Check power and the node cabling between boards; the discovered board names, firmware versions, and switch/driver counts are printed in the startup logs. |