2026-05-02
The asker has a 3D printer controlled exclusively through a touchscreen (MKS PI-TS35, driven by an ILI9488 controller over SPI at 20 MHz) and wants to add remote control. The plan: use an FPGA to passively sniff the SPI framebuffer data going to the display, reconstruct the image for streaming, and also inject synthetic touch events back into the system — effectively building a remote KVM for an embedded device that was never designed for one.
This is a genuinely compelling problem because it sits at the intersection of several non-trivial challenges:
CASET/RASET commands followed by RAMWR), meaning the host MCU rarely sends a full frame. The FPGA must maintain a shadow framebuffer and apply partial updates to the correct pixel regions. Missing or misinterpreting a single command/address packet corrupts the entire display state until the next full redraw.A practical approach would be to start with an iCE40 or ECP5-class FPGA, implement the SPI sniffer as a passive tap (high-impedance on the display SPI lines), decode the ILI9488 command stream with a state machine tracking CASET/RASET/RAMWR sequences, and write decoded pixels into a dual-port block RAM framebuffer. For touch injection, a separate SPI slave module can intercept the touch controller's CS line via an analog mux, allowing the FPGA to respond with synthetic coordinates when remote input is active. An ESP32 or RP2040 companion over a fast SPI or parallel link could handle the network side.
The biggest gotcha is protocol synchronization on startup: if the FPGA starts listening mid-stream, it may misinterpret data bytes as commands. A robust design needs a resynchronization mechanism — watching for known initialization sequences or CS deassertion boundaries to re-establish framing.
