

Crsf2pwm board
FPGA based CRSF-to-PWM converter for an RC car
- Size
- 75 × 55 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 20
- Nets
- 50
- Pads
- 150
- Tracks, vias
- 331, 18
- Pours
- 3
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 27 Sep 2026
- Updated
- 29 Oct 2026
Overview
Crsf2pwm board is an open-source printed circuit board by alex-aparin, from the alex-aparin/crsf2pwm repository on GitHub. It is a 2-layer board of 75 × 55 mm with 20 parts on 50 nets, routed with 331 tracks and 18 vias.
It is built around the EPM240T100C3 and AMS1117-3.3. Its parts include 7 capacitors, 4 connectors, 2 resistors, 2 ICs and 1 crystal. It belongs with the robots and motor control and fPGA and programmable logic boards and the FPGA and CPLD boards of this library.
Main components
2EPM240T100C3
TQFP-100(14x14)0℃~+85℃ 192 2.5V、3.3V 240 240 4.7ns 80 In-system programming MAX II TQFP-100(14x14) Programmable Logic Device (CPLDs/FPGAs)Intel/AlteraProgrammable Logic Device (CPLDs/FPGAs)AMS1117-3.3
SOT-223-40℃~+125℃ 0.003%Vout 1 1.1V@(800mA) 15V 1A 3.3V 5mA 72dB@(120Hz) Fixed Over Current Protection、Short Circuit Protection、Thermal shutdown Positive SOT-223 Voltage Regulators - Linear, Low Drop Out (LDO) Regulators ROHSAdvanced Monolithic SystemsVoltage Regulators - Linear, Low Drop Out (LDO) Regulators
README
README.mdcrsf2pwm
CRSF-to-PWM converter for an RC car: receives CRSF from an ExpressLRS or Crossfire receiver over UART and outputs two servo PWM signals, one for the steering servo and one for the motor ESC. Plain synthesisable SystemVerilog, one clock, no vendor primitives. The current target is a Cyclone IV E development board; a MAX II EPM240 revision exists but the design is a few logic cells too big for it.
Layout
rtl/ synthesizable code, the only thing that goes into Quartus
tb/ testbenches for Icarus Verilog, one per module plus tb_top
tb/lib/ helpers shared by the testbenches (CRC, frame building)
tb/model/ Python reference model and the test vector generator
tb/vectors/ generated vectors, committed, `make vectors` regenerates them
sim/ Makefile for running simulations, waveforms land here
quartus/ Quartus project: .qpf, one .qsf per revision, .sdc, the clock probe
tools/ build, JTAG check, program, udev rule for the USB Blaster
hw/ KiCad board project
docs/ notes: design, CRSF protocol, servo PWM, pinout, board bring-upDesign
rx -> 2 FF sync -> uart_rx -> crsf_parser -> steer_val ----------> pwm_chan -> steer
-> thr_val -> failsafe mux -> pwm_chan -> throttle
-> frame_valid -> link watchdog
pwm_timebase -> tick, start, head -> both channels, watchdogdocs/design.md has the module contracts, the timing, the failsafe policy,
the LE budget and the reasoning behind the choices. docs/crsf.md and
docs/servo_pwm.md cover the two protocols.
Tools (Linux)
Simulation and lint from the distribution:
sudo apt install iverilog gtkwave make python3 verilatorQuartus Prime Lite for synthesis and programming: the small installer from
altera.com (qinst-lite-linux-<version>.run, free, needs an account),
components Quartus Prime plus the Cyclone IV device support, and MAX II if
the CPLD revision matters; Questa is not needed. It lands in
~/altera_lite/<version>/quartus, which is not on PATH: the scripts in
tools/ find it by themselves, and . tools/quartus-env.sh puts it on
PATH for a shell. The USB Blaster needs tools/udev-install.sh once.
Verified with Icarus 11, Verilator 5.052, Quartus Prime Lite 25.1std on Ubuntu 22.04.
Simulation
Without make, from the sim directory:
mkdir build
iverilog -g2012 -Wall -I ../tb/lib -s tb_top -o build/tb_top.vvp ../tb/tb_top.sv ../rtl/*.sv
vvp -N build/tb_top.vvp
gtkwave build/tb_top.vcdWith make:
cd sim
make all testbenches
make tb_top one testbench
make pwm_out same as make tb_pwm_out
make waves-tb_top open waveforms in GTKWave
make lint Verilator lint, if installed
make vectors regenerate tb/vectors from the Python modelEvery testbench is self-checking: it prints PASS and exits 0, or prints the
failing checks and exits 1 through $stop, so make fails and the VS Code
task turns red. A watchdog ends a hung run.
make waves-tb_top also loads sim/tb_top.gtkw if it exists. Save one from
GTKWave with File > Write Save File to keep the signal layout between runs.
Continuous integration
.github/workflows/sim.yml runs on every push and pull request: all
testbenches in Icarus (make -C sim -k all), the Python model self-test with
a check that the committed tb/vectors/ match the generator, and Verilator
lint of the RTL with -Wall. The waveforms of a failed run are attached to
the run as an artifact for a week. The badge above shows the state of main.
.github/workflows/hw.yml runs on changes under hw/: ERC of the schematic
and DRC of the board with kicad-cli 10.0 (through actions-for-kicad/kicad-actions),
plus a PDF of the schematic and of the board layers. Reports and PDFs are
attached to the run as the board artifact for 30 days. ERC tolerates only
"Pin not connected" on the unused U1 pins, which have no no-connect flags yet.
VS Code
.vscode/ has tasks and recommended extensions. Open a testbench or a module
file and press Ctrl+Shift+B: the testbench for that file runs in sim/, so
rtl/pwm_out.sv and tb/tb_pwm_out.sv both run tb_pwm_out. Errors from
Icarus appear in the Problems panel. Other tasks under Terminal > Run Task:
waves in GTKWave, run + waves, all testbenches, lint, clean.
The Verilog-HDL extension lints the open file with Icarus on save. The Surfer
extension opens a .vcd from sim/build/ inside VS Code as an alternative
to GTKWave.
Build and program
The Quartus project quartus/crsf2pwm.qpf has three revisions:
| Revision | Target | Output |
|---|---|---|
crsf2pwm_c4 | the Saylinx Cyclone IV board, EP4CE6F17C8N | .sof, and .jic for the flash |
clock_probe | the same board, bring-up helper: oscillator to LEDs and header pins | .sof |
crsf2pwm | MAX II EPM240 | .pof; 234 of 240 LEs with the area settings in the .qsf, see docs/design.md |
Everything goes through the scripts in tools/, which find Quartus, check
the cable and print the numbers that matter:
tools/udev-install.sh once: let Quartus open the USB Blaster
tools/jtag-check.sh cable found? board answering?
tools/build.sh [revision] compile, default crsf2pwm_c4; errors, warnings by code, LEs, slack
tools/program.sh [revision] into the FPGA over JTAG, gone at power-off
tools/program.sh --flash into the configuration flash, loads at every power-up
tools/crsf_send.py [options] play a receiver: CRSF frames from the PC over the board's USB-UART (pyserial)The step-by-step procedure with what to expect at each step, from the
first jtagconfig to the car, is docs/bringup.md. The GUI works too:
open the .qpf, pick the revision under Project > Revisions, Start
Compilation, Programmer.
Current state: the Cyclone IV revision compiles clean in Quartus Prime
Lite 25.1 (273 LEs, Fmax well above 50 MHz) with the pins from
docs/pinout.md. Not yet confirmed on the board.
Parts
20| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | 100n | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C1, C2, C3, C4, C5 |
| 2 | 220 | Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolder | R1, R2 |
| 2 | Conn_01x03_Pin | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J1, J2 |
| 1 | 10u | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C6 |
| 1 | 22u | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C7 |
| 1 | AMS1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U2 |
| 1 | ASV-xxxMHz | Oscillator:Oscillator_SMD_Abracon_ASV-4Pin_7.0x5.1mm | Y1 |
| 1 | Conn_01x04_Pin | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J3 |
| 1 | EPM240T100 | Package_QFP:LQFP-100_14x14mm_P0.5mm | U1 |
| 1 | JTAG | Connector_IDC:IDC-Header_2x05_P2.54mm_Vertical | J4 |
The 16 most common of 20 parts.
Similar boards
- 2 layers78.7 × 85.7 mm

- 2 layers85.4 × 64 mm

DaewooBackslotRAMExpansion
RBSC/Daewoo_CPC400_Upgrade
Upgrading Daewoo CPC-400/400S into MSX2/MSX2+
29 parts4 - 4 layers119.1 × 99.1 mm

- 4 layers209.6 × 108.5 mm

- 4 layers100 × 43.5 mm

- 2 layers102 × 71 mm

REF1329 Altera
RWeick/REF1329-N64-Gameshark-Clone
This implements the original LZ9FC17 GAL on an Altera EPM240. It fully supports all functionality to include: parallel port, 7 segment display, and the GS button
41 parts48GPL-3.0 - 4 layers49.3 × 72.3 mm

G76-Mini
mtabini/G76-Mini
An inexpensive VGA circuit designed specifically for homebrew 8-bit computers
28 parts9MIT - 2 layers76.6 × 57.4 mm

Divtiesus acer
arleybls/divtiesus-acer
Custom 2-layer PCB re-layout of DivTIESUS — a DivMMC SD card interface for the ZX Spectrum, with the upstream CPLD firmware unchanged.
42 parts3
Questions
How big is the Crsf2pwm board PCB?
It measures 75 × 55 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Crsf2pwm board use?
20 parts, built around the EPM240T100C3 and AMS1117-3.3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.
Where can I download the Crsf2pwm board KiCad files?
From the alex-aparin/crsf2pwm repository on GitHub, at the commit this page was made from: the board is hw/crsf2pwm-board/crsf2pwm-board.kicad_pcb and its schematic hw/crsf2pwm-board/crsf2pwm-board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Crsf2pwm board design in my own project?
Its repository states no licence, so its author keeps all rights: ask alex-aparin before reusing the design.