

Hx4k pmod
Lattice HX4K breakout board, designed for hand-assembly
- Size
- 100 × 55 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 103
- Nets
- 169
- Pads
- 535
- Tracks, vias
- 959, 108
- Pours
- 6
- Routed
- Yes
- KiCad
- KiCad 5 (file 20171130)
- Created
- 29 Mar 2020
- Updated
- 8 Sep 2020
Overview
Hx4k pmod is an open-source printed circuit board by rschlaikjer, from the rschlaikjer/hx4k-pmod repository on GitHub, published under the MIT licence. It is a 2-layer board of 100 × 55 mm with 103 parts on 169 nets, routed with 959 tracks and 108 vias.
It is built around the ICE40HX4K-TQ144 and W25Q128JVSIQ. Its parts include 53 capacitors, 19 resistors, 13 connectors, 6 ICs and 5 diodes. It belongs with the fPGA and programmable logic and interfaces and adapters boards and the STM32 and FPGA and CPLD boards of this library.
Main components
2ICE40HX4K-TQ144
TQFP-144(20x20)-40℃~+100℃ 1.14V~1.26V 107 3520 440 81920bit iCE40 HX TQFP-144(20x20) Programmable Logic Device (CPLDs/FPGAs) ROHSLatticeProgrammable Logic Device (CPLDs/FPGAs)W25Q128JVSIQ
SOIC-8-208mil-40℃~+85℃ 100,000 cycles 120ms@(32KB) 128Mbit 133MHz 1uA 2.7V~3.6V 20 Years 3ms Power-on reset、Hardware write protection、Software write protection、Write enable latch、Absolute write protection SPI SOIC-8-208mil NOR FLASH ROHSWinbondNOR FLASH
README
README.mdHX4k PMOD Breakout
This repository contains the KiCad hardware design files, flash programming firmware and some gateware samples for a basic FPGA breakout board based on the Lattice Ice40 HX4K.
More information about this project can be found in this blog post.

Building the hardware
Prerequisites
- Soldering iron (TS-100 or TS-80 would be fine for this)
- Flux (Massively simplifies the soldering of the QFP packages)
- Fine tweezers (I recommend Rhino SW-11 or comparable)
- [Optional] Hot air rework station. The '858D' hot air station is available from many resellers at reasonable prices, and is more than adequate.
One of the design goals for this board was for it to be feasible to assemble by hand, using only a soldering iron. To that end, all of the critical components are leaded packages, and there are no passives smaller than 0805. For some components (USB type-C connector J4, 12MHz oscillator X1 and RGB LEDs D1 and U4), a hot air gun may be advantageous, but it is possible to get away without one.
Ordering PCBs
If you have done this before, you can clone this repo and then zip up the gerber fills in the hardware/gerber/ directory and upload them to your preferred board house. Alternately, or for convenience, you can order this design directly from PCBWay, a budget PCB house with respectable quality and turnaround time.
Bill of materials
The KiCad design files are fully specified with the manufacturer and DigiKey
part numbers for all components involved. Also included in the hardware/ folder
is a DigiKey BOM CSV (digikey_bom.csv), which can be uploaded
here and used to immediately add the necessary
components to an order. Note that the BOM item quantity is for precisely one
unit - I would recommend going through and adding whatever fudge factor you
feel is reasonable to cheaper passives and other parts you want some margin for
error with.

At time of writing, the total cost of the BOM for no more than one board is $37.60. If you intend to make more than one, the unit price will of course decrease.
Assembly
I highly recommend printing out the F.Fab and B.Fab layers of the KiCad
design before getting to work, as these contain a wireframe layout of all the
components, as well as their associated values (pictured on right hand side). I
would also recommend starting with the center of the major component sections
(U1, U3) and working outwards to smaller components, otherwise some of the
decoupling caps near the chips may make it tricky to solder the QFPs.
If you are using a hot air station for assembly, I would recommend applying flux to the pads, tinning them, placing the component on top and then using the hot air tool to reflow it into place. I find 350°C to work well for leaded solder. Be careful not to overheat the LEDs, as the plastic may melt.

Flashing the microcontroller
Once you have the hardware assembled, you will need to program the onboard microcontroller. This micro then acts in much the same way as an FTDI FT2232 (but costs significantly less), and once set up allows for
- Writing bitstreams / other data to the onboard flash chip
- Creating a USB serial bridge to the FPGA
- Any other custom logic you want to add. The microcontroller has one hardware SPI connected directly to the FPGA for end user applications.
To build the firmware, you will need the arm-none-eabi GCC toolchain:
sudo apt install gcc-arm-none-eabi gdb-arm-none-eabi binutils-arm-none-eabiYou should then be able to build the firmware as a normal CMake project:
# Ensure submodule for libopencm3 is present
git submodule init
git submodule update
# Build
mkdir programmer_firmware/build
pushd programmer_firmware/build
cmake ../
make -j$(nproc)To program, it is assumed that you will be using the
Black Magic Probe
with a
TagConnect TC-2050-NL
cable to connect to the programming pads on the board. In this case, after
connecting power to the board through either the USB connector or auxiliary
power connector, you can
run the cmake target fpga_programmer_flash to attach to the microcontroller
and load the firmware. You should see output like the following:
ross@mjolnir:/h/r/P/G/f/p/build$ make fpga_programmer_flash
[ 44%] Built target libopencm3
[100%] Built target fpga_programmer_elf
Black Magic Probe (Firmware v1.6.1-311-gfbf1963) (Hardware Version 3)
Available Targets:
No. Att Driver
1 STM32F07 M0
event_loop () at /home/ross/Programming/Github/fpga-swe-1/programmer_firmware/src/main.cpp:87
87 }
Loading section .text, size 0x29e4 lma 0x8000000
Loading section .init_array, size 0x8 lma 0x80029e4
Loading section .data, size 0x14 lma 0x80029ec
Start address 0x8001e84, load size 10752
Transfer rate: 18 KB/sec, 768 bytes/write.
Section .text, range 0x8000000 -- 0x80029e4: matched.
Section .init_array, range 0x80029e4 -- 0x80029ec: matched.
Section .data, range 0x80029ec -- 0x8002a00: matched.
Kill the program being debugged? (y or n) [answered Y; input not from terminal]
[100%] Built target fpga_programmer_flashYou should then see the board show up as a USB device, with the default VID:PID set to a generic test PID:
ross@mjolnir:/h/r/P/G/f/p/build$ lsusb -d 1209:0001
Bus 001 Device 106: ID 1209:0001 Generic pid.codes Test PIDYou should also notice that it has supplied a new serial device. This serial port controls the hardware UART on the microcontroller, which is connected directly to two pins on the FPGA and by default expects a baudrate of 2M.
Flashing the FPGA
In order to generate bitstreams for the FPGA, you will first need to install yosys, icestorm and nextpnr. Instructions for all of them are on their respective homepages.
Once these are installed, if you run make in the gateware/ subfolder you
should be able to generate a top.bin bitstream of the demo application, which
will blink some lights and act as an echo UART.
In order to upload the bitstream, you will then need to build faff, a tool that handles the USB communication necessary to erase and reprogram the flash through the microcontroller.
Once you have that installed and in your $PATH, you can run make prog from
the gateware/ directory and should see it connect and program successfully:
ross@mjolnir:/h/r/P/G/f/gateware$ make prog
faff -f top.bin
Claimed device 1209:0001 with serial 004700254753511120303234
Flash chip mfgr: 0xef, Device ID: 0x17 Unique ID: 0xe4682c404b163333
Programming block 0x00020fa0 / 0x00020fbc
Reading block 0x00020fa0 / 0x00020fbcYour FPGA should now cycle through some various colours on the RGB LED.

Parts
103| Qty | Value | Footprint | References |
|---|---|---|---|
| 24 | 1uF | Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder | C3, C10, C11, C12, C15, C17, C18, C19, C20, C21, C22, C24, C35, C37, C39, C41 +8 |
| 14 | 0.1uF | Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder | C1, C13, C14, C16, C23, C34, C36, C38, C40, C42, C44, C46, C48, C50 |
| 10 | PMOD | Connector_PinSocket_2.54mm:PinSocket_2x06_P2.54mm_Horizontal | J2, J5, J6, J7, J8, J9, J10, J11, J12, J13 |
| 9 | 10uF | Capacitor_SMD:C_0805_2012Metric_Pad1.15x1.40mm_HandSolder | C2, C4, C6, C8, C25, C26, C27, C28, C32 |
| 9 | 330R | Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder | R2, R3, R4, R5, R13, R14, R15, R18, R19 |
| 8 | 10k | Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder | R1, R6, R7, R8, R9, R10, R11, R12 |
| 6 | 100uF | Capacitor_SMD:CP_Elec_6.3x5.8 | C29, C52, C53, C54, C55, C56 |
| 4 | MountingHole | MountingHole:MountingHole_3.2mm_M3 | H1, H2, H3, H4 |
| 2 | 5.1k | Resistor_SMD:R_0805_2012Metric_Pad1.15x1.40mm_HandSolder | R16, R17 |
| 2 | DMG3401LSN-7 | Package_TO_SOT_SMD:SC-59 | Q1, Q2 |
| 2 | LED_ABGR | _LEDs:LED_Cree_PLCC4_RGB | D1, U4 |
| 2 | LED_GRN | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D3, D4 |
| 1 | ART | Logo:fishbox_5mm_600dpi | U7 |
| 1 | AZ1117-1.2 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U6 |
| 1 | AZ1117-3.3 | Package_TO_SOT_SMD:SOT-223-3_TabPin2 | U5 |
| 1 | Conn_01x02 | _Connector_Molex:Conn_Molex_Mini-Fit-JR_2pos_RA_4.2mm | J3 |
| 1 | Conn_ARM_JTAG_SWD_10 | Connector_TagConnect:Tag-Connect_TC2050-IDC-NL_2x05_P1.27mm_Vertical | J1 |
| 1 | ECS-2520MV-120 | _Oscillators:XTAL_OSC_ECS_2520 | X1 |
| 1 | ICE40HX4K-TQ144 | Package_QFP:TQFP-144_20x20mm_P0.5mm | U1 |
| 1 | LED_BLU | LED_SMD:LED_0805_2012Metric_Pad1.15x1.40mm_HandSolder | D2 |
| 1 | STM32F070CBTx | Package_QFP:LQFP-48_7x7mm_P0.5mm | U3 |
| 1 | USB_C_Receptacle_USB2.0 | _Connector_USB:Conn_USB_C_Receptacle_GCT_USB4105-GF-A | J4 |
| 1 | W25Q128JVS | Package_SO:SOIC-8_5.23x5.23mm_P1.27mm | U2 |
Similar boards
- 4 layers85 × 54 mm

- 2 layers100 × 100 mm

Open65
Maverick-Shark/X65_BigMiST
The X65 is an ultimate computer for everyone interested in the venerable 65-series of 8-bit and 16-bit CPUs, i.e. the 6502 and 65816.
195 partsMIT - 2 layers106.4 × 95 mm

- 2 layers104.1 × 71.1 mm

Minifp
eigenco/frankenpi
This is an experimental project to connect Raspberry Pi with the help of cheap Cyclone IV FPGA board to 8-bit ISA bus to act as multiple different devices.
69 parts139 - 6 layers304.8 × 243.8 mm

- 2 layers284.7 × 94.2 mm

Nyan keys v09b
portlandhodl/nyan-keys-hardware
Hardware document for the nyan keys keyboard
144 parts96Apache-2.0 - 4 layers100 × 180 mm

- 4 layers99.1 × 66 mm

2057-ICE40HX4K TQ144-breakout
johnwinans/2057-ICE40HX4K-TQ144-breakout
Minimal Raspberry PI breakout board for ICE40HX4K FPGA
75 parts25
Questions
How big is the Hx4k pmod PCB?
It measures 100 × 55 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Hx4k pmod use?
103 parts, built around the ICE40HX4K-TQ144 and W25Q128JVSIQ. 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 Hx4k pmod KiCad files?
From the rschlaikjer/hx4k-pmod repository on GitHub, at the commit this page was made from: the board is hardware/hx4k_pmod.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.
Can I use the Hx4k pmod design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).