Turn Your Raspberry Pi Pico into a Professional JTAG Programmer with DirtyJTAG & OpenFPGALoader
5 min
- Project Overview
- Why OpenFPGALoader + DirtyJTAG Wins
- How It Works: Pico as DirtyJTAG Adapter
- Step-by-Step Setup on Windows (Exact Commands from the Project)
- Custom FPGA Board + JLCPCB PCBA
- Real-World Testing: Two Lattice ECP5 Demos
- Real-World Testing: Two Lattice ECP5 Demos
- How to Build Your Own Pico JTAG Programmer + Custom FPGA Board
- Final Thoughts
- FAQs
In the world of FPGA development, having a reliable, low-cost JTAG programmer used to mean either buying expensive vendor cables or adding high-cost FTDI chips to every board. Maker Khaled Magdy changed that by turning a $4 Raspberry Pi Pico into a fully functional JTAG adapter using DirtyJTAG firmware and OpenFPGALoader — then had his custom FPGA boards professionally assembled by JLCPCB.
The entire solution is 100% open-source. You can download the firmware, follow the Windows installation steps, and order your own custom FPGA PCBs with JLCPCB PCBA in minutes.

Project Overview
This setup lets you program almost any FPGA (Lattice ECP5, iCE40, Artix-7, Gowin, Efinix, and more) using a single $4 Pi Pico as your JTAG cable. No more carrying multiple vendor programmers. The same USB port even provides UART debugging.
Author Khaled Magdy explains: “I’ve been using FTDI solutions for years. Recently I decided to give open-source a try — and the cost savings plus universal support made it an easy choice for all my future custom FPGA designs.”
Why OpenFPGALoader + DirtyJTAG Wins
· Cost Optimization: Replace a $9 FTDI chip with a $1 MCU. Same USB-JTAG + USB-UART functionality.
· Universal Support: Works with Xilinx, Altera, Lattice, Gowin, Efinix and more.
· Open-Source Toolchain Friendly: Perfect with Yosys/nextpnr — no vendor tools required.
How It Works: Pico as DirtyJTAG Adapter
The Pico-DirtyJTAG firmware uses the RP2040’s PIO to emulate a full JTAG interface. Default pinout is simple:
| Signal | GPIO | Pico Pin |
| TDI | 16 | 21 |
| TDO | 17 | 22 |
| TCK | 18 | 24 |
| TMS | 19 | 25 |
| RST | 20 | 26 |
| TRST | 21 | 27 |
Flash the UF2 file once, install the WinUSB driver with Zadig, and you’re ready.

Step-by-Step Setup on Windows (Exact Commands from the Project)
1. Download & build Pico-DirtyJTAG in VS Code → flash UF2 to Pico.
2. Install MSYS2.
3. Run: pacman -S mingw-w64-ucrt-x86_64-openFPGALoader
4. Open MSYS2 UCRT64 terminal and verify: openFPGALoader -V
5. Use Zadig to switch Pico to WinUSB driver.
6. Connect JTAG pins to your FPGA.
7. Detect: openFPGALoader -c dirtyJtag --detect
Load bitstream to SRAM:
openFPGALoader -c dirtyjtag --bitstream MyDesign.bitFlash to external SPI FLASH:
openFPGALoader -c dirtyjtag -f MyDesign.bit --write-flash
Custom FPGA Board + JLCPCB PCBA
Khaled designed a full custom Lattice ECP5 board and used JLCPCB for fabrication and assembly. The process was exactly the same as any JLCPCB project:
1. Upload Gerber files and choose 2-layer options.
2. Upload BOM + CPL files — JLCPCB auto-matches components from its library.
3. Review 3D preview and place the order (use coupon for extra savings).
4. Boards arrived in days, fully assembled and ready for testing.
“JLCPCB made professional-grade FPGA hardware accessible and affordable,” Khaled noted. “The quality exceeded expectations — perfect for integrating my new DirtyJTAG solution.”
Real-World Testing: Two Lattice ECP5 Demos
GPIO Demo: Button controls one LED, others stay OFF after power cycle — bitstream loaded permanently to SPI FLASH via OpenFPGALoader.
UART Demo: Loopback test between FPGA and Pico (USB CDC) — proves both JTAG programming and serial debugging work on the same USB port.Both demos ran flawlessly after JLCPCB assembly.
“JLCPCB made professional-grade FPGA hardware accessible and affordable,” Khaled noted. “The quality exceeded expectations — perfect for integrating my new DirtyJTAG solution.”
Real-World Testing: Two Lattice ECP5 Demos
GPIO Demo: Button controls one LED, others stay OFF after power cycle — bitstream loaded permanently to SPI FLASH via OpenFPGALoader.
UART Demo: Loopback test between FPGA and Pico (USB CDC) — proves both JTAG programming and serial debugging work on the same USB port.Both demos ran flawlessly after JLCPCB assembly.

How to Build Your Own Pico JTAG Programmer + Custom FPGA Board
Download Pico-DirtyJTAG and OpenFPGALoader from GitHub.
Flash firmware to any Pi Pico.
Follow the Windows steps above (5 minutes).
Design your FPGA PCB in KiCad or Lattice Diamond.
Upload Gerber/BOM/CPL to jlcpcb.com → enable PCBA.
Receive factory-assembled boards and start programming instantly!
Project Specifications
· Programmer: Raspberry Pi Pico (RP2040) + DirtyJTAG firmware
· Tool: OpenFPGALoader (supports 20+ FPGA families)
· Cost: ~$4 total for JTAG cable
· Features: SRAM + SPI FLASH programming, USB-UART bridge
· Compatible FPGAs: Lattice ECP5, iCE40, Artix-7, Gowin, etc.
· License: Fully open-source
Final Thoughts
This project proves that professional FPGA development no longer needs expensive tools. With a $4 Pico, open-source software, and JLCPCB’s reliable PCBA service, anyone can build and program custom FPGA hardware at hobbyist prices.
Whether you’re creating your first FPGA board or scaling to production, this combination is the perfect starting point.
Ready to build your next FPGA project?
Get an instant quote for PCB + PCBA at JLCPCB today!
All files are free to download and use. Go create something amazing — you can do it
FAQs
Q1: Why use DirtyJTAG instead of FTDI?
Saves ~$8 per board while providing the same JTAG + UART functionality on one USB port.
Q2: Which FPGAs are supported?
Lattice ECP5, iCE40, Xilinx Artix-7/Spartan, Gowin, Efinix and many more — full list in OpenFPGALoader wiki.
Q3: Can I flash bitstream to external SPI FLASH?
Yes! Use openFPGALoader -c dirtyjtag -f file.bit --write-flash.
Q4: Is the firmware open-source and free?
100% — both Pico-DirtyJTAG and OpenFPGALoader are open-source with complete GitHub repos.
Popular Articles
• High-Quality Small Batch Guitar Effect Pedal PCBs with JLCPCB Manufacturing
• How JLCPCB Helped a Non-Verbal Girl Communicate Her Needs
• JLCPCB Empowering Innovation: The Journey of an Autonomous Exploration Vehicle
• Building a Custom Laptop with JLCPCB's Full Services
• Growing LED Butterflies Built with JLCPCB's Transparent FPCs
Keep Learning
Turn Your Raspberry Pi Pico into a Professional JTAG Programmer with DirtyJTAG & OpenFPGALoader
In the world of FPGA development, having a reliable, low-cost JTAG programmer used to mean either buying expensive vendor cables or adding high-cost FTDI chips to every board. Maker Khaled Magdy changed that by turning a $4 Raspberry Pi Pico into a fully functional JTAG adapter using DirtyJTAG firmware and OpenFPGALoader — then had his custom FPGA boards professionally assembled by JLCPCB. The entire solution is 100% open-source. You can download the firmware, follow the Windows installation steps, an......
Build a Professional 8x8 RGB LED Matrix with JLCPCB
In the world of DIY electronics, building a clean, reliable 8×8 RGB LED matrix used to mean hours of painstaking hand-soldering — 64 WS2812B LEDs plus 64 decoupling capacitors. That all changed when maker Lucas Fernando designed a fully custom PCB from scratch and had it professionally assembled by JLCPCB on his very first try. The result? Five perfectly finished, ready-to-use 8×8 addressable LED matrices that look like commercial products. Best of all, the entire project is 100% open-source. You can ......
PIC16F877A Master Trainer Board: An All-In-One Learning Tool Supported by JLCPCB
In the realm of embedded systems training and quick prototyping, a solid trainer board is key for mastering microcontroller skills and hardware integration. This feature highlights the creation of the PIC16F877A Master Trainer Project, a multifunctional board centered on Microchip's renowned 8-bit microcontroller. The PIC16F877A, part of Microchip's mid-range family, has been a staple in electronics education since its introduction in the late 1990s, offering a balance of performance, cost, and ease o......
How JLCPCB’s Flex PCB Enable Smarter GPS Tracking Devices
Smart tracking technologies require reliable, high-performance hardware to function effectively. QIYUE TECH, an IoT company, uses JLCPCB’s Flex PCBs to improve the performance and compact design of its smart tracking devices, such as the TR-DOG® series and anti-tamper GPS smartwatches. These flexible PCBs provide the durability and adaptability needed for consistent performance in dynamic real-world environments. Product introduction Meet the TR‑DOG Series The TR‑DOG® system combines a handheld displa......
Building a Custom Laptop with JLCPCB's Full Services
Imagine designing a laptop from the ground up—not just assembling parts, but crafting its circuits, chassis, and cooling systems by hand. "This is a fully custom-built laptop project where I designed and manufactured many of the key components, with the help of JLCPCB's outstanding services. While I didn't design the main motherboard itself, I developed and integrated many of the surrounding subsystems and mechanical elements myself." This project shows how a maker leveraged JLCPCB's full-service manu......
Growing LED Butterflies Built with JLCPCB's Transparent FPCs
What if a butterfly could flutter with light? No wires, bulk, and complex control, just motion and glow. That's exactly what this glowing FPC-based creation achieves! Built with JLCPCB's 2-layer transparent FPC, this elegant LED butterfly is lightweight, low-power, and visually striking, showing how seamlessly advanced electronics can blend with creative aesthetics. Let’s take a closer look at how this idea took flight and how JLCPCB's services made it all possible. Project Introduction This artistic ......