Skip to the content
2 layers75 × 55 mmCrsf2pwm board, the printed circuit board in 3D

Crsf2pwm board

alex-aparin/crsf2pwm

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

2

README

README.md

crsf2pwm

sim hw

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

text
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-up

Design

text
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, watchdog

docs/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:

text
sudo apt install iverilog gtkwave make python3 verilator

Quartus 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:

text
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.vcd

With make:

text
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 model

Every 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:

RevisionTargetOutput
crsf2pwm_c4the Saylinx Cyclone IV board, EP4CE6F17C8N.sof, and .jic for the flash
clock_probethe same board, bring-up helper: oscillator to LEDs and header pins.sof
crsf2pwmMAX 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:

text
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
QtyValueFootprintReferences
5100nCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC1, C2, C3, C4, C5
2220Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1, R2
2Conn_01x03_PinConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ1, J2
110uCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC6
122uCapacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolderC7
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U2
1ASV-xxxMHzOscillator:Oscillator_SMD_Abracon_ASV-4Pin_7.0x5.1mmY1
1Conn_01x04_PinConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1EPM240T100Package_QFP:LQFP-100_14x14mm_P0.5mmU1
1JTAGConnector_IDC:IDC-Header_2x05_P2.54mm_VerticalJ4

The 16 most common of 20 parts.

Similar boards

  • 2 layers78.7 × 85.7 mmMAXwel, the printed circuit board in 3D

    MAXwel

    MitchiLaser/MAXwel

    Cheap DIY FPGA development board

    156 parts1GPL-2.0
  • 4 layers119.1 × 99.1 mmIo board, the printed circuit board in 3D

    Io board

    svpetry/Mini8086

    A small 8086 computer system.

    87 parts3
  • 4 layers209.6 × 108.5 mmGPIO, the printed circuit board in 3D

    GPIO

    89Mods/LVDC

    Replica of the Launch Vehicle Digital Computer using 74-series logic

    113 parts2MIT
  • 4 layers100 × 43.5 mmPistorm ste, the printed circuit board in 3D

    Pistorm ste

    gotaproblem/pistorm-atari

    PISTORM for the ATARI ST

    31 parts49MIT
  • 2 layers102 × 71 mmREF1329 Altera, the printed circuit board in 3D

    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 mmG76-Mini, the printed circuit board in 3D

    G76-Mini

    mtabini/G76-Mini

    An inexpensive VGA circuit designed specifically for homebrew 8-bit computers

    28 parts9MIT
  • 2 layers76.6 × 57.4 mmDivtiesus acer, the printed circuit board in 3D

    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.