Frame grabber plus touch simulation

2026-05-02

Stack Overflow: View Question

Tags: fpga, 3d-printing

Score: 0 | Views: 45

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:

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.

The challenge: Building a transparent SPI man-in-the-middle that can both reconstruct a display framebuffer from partial updates and inject synthetic touch events without disrupting the real-time communication between host MCU and peripherals.

All newsletters