AUTOMATIXARON
Hands on a tiny and affordable FPGA board
Aim of the tutorial:
This page will be more of a first impression kind of page than a tutorial. We will look at a cheap but powerful FPGA board, which has fully open source hardware.
A short intro for FPGAs:
These strange devices called CPLDs (Complex Programmable Logic Devices), and FPGAs (Field Programmable Gate Arrays) are different than the more known microcontrollers. The later ones have fixed hardware, and the user creates a firmware that runs on the chip, which tells how the chip will use its resources. The former is like a blank canvas, where the user has to create the hardware and optionally the software too. There is no processor - until you design one.
The FPGA has certain hardware-level flexibility, which allows the user to reconfigure the hardware rather than replace it.
The downside is the high cost of such chips, even higher cost of development boards - since FPGAs usually need multiple power rails, matched signal paths and multiple layers for signal integrity, and external memory units, oh, and these pesky devices come in a not so user-friendly BGA packages. And the worst of the downsides is the steep learning curve of the design language and method of thinking.
So far the reader might think that the downside far outweighs the upside, but here comes the TinyFPGA board.
So far I've been working with Basys2, Basys3, and ZYBO development boards from Digilent (using Spartan3, Artix-7 and Zynq-7000 chips from Xilinx), Waxwing board from NumatoLabs (using Spartan6 from Xilinx). These are all powerful FPGA boards and have two things in common: their high price range, and the fact that I never managed to use the fabric to the full capacity.
​
And finally we arrived to the TinyFPGA boards, which have fully open source hardware design. These boards incorporate FPGAs from Lattice semiconductor. The A1 and A2 boards have MachXO2-256 and MachXO2-1200, the B board has an ICE40LP8K and the EX board has an LFE5U-25F FPGA chip. The upside of these FPGA chips is that the Mach and ICE ones allso come in QFN packages, which can be hand soldered. Another upside is that these chips have an internal flash, internal oscillator and require fewer voltage rails, which further simplify the board design process.
​
While the A boards must be programmed with a JTAG programmer (which incidentally is made with a low-cost PIC16LF1455, and has open source hardware and firmware), the B devices are pre programmed with a USB bootloader.
​
Here you can see the TinyFPGA A2 board, which truely lives up to its name. Every component is on the top side of a 3.05 cm x 1.8 cm PCB. The FPGA has 1280 Look Up Tables (LUTs), 10kb of distributed RAM, 64kb of ERB SRAM, 64kb FLASH, 18 I/O, 1 hard SPI, 2 hard I2C, 1 PLL, 1 hard Timer/Counter IP, all with WishBone interface. The datasheet for the MachXO2 devices can be found here.
This particular board also comes with some bad looking lead-free solder joints, but I was in a hurry to test the FPGA.
FPGA testing
About the Tiny FPGA boards


And here is the programmer, which is a little beauty in itself.
First I've downloaded and installed the Lattice Diamond development environment with service pack 2 (I also requested a free license). After that, I've downloaded the programmer application from the git-hub repository, which is a simple python program with a GUI. Finally, I've downloaded a LED blinking project to test the FPGA and the programmer.
When I connected the USB programmer, Windows automatically recognized it and installed the required drivers.
​
The Demo project used the internal oscillator as a clock source for a 24b up counter module. The last 3 bits of the counter module were fanned out to 3 LEDs (an RGB LED in my case). Diamond successfully synthesized and routed the design, and finally, it produced the JEDEC file (this programmer uses the JEDEC file instead of the bitstream file).
The programmer application easily recognized the TinyFPGA programmer in COM7 port. The file uploading/programming step was fast, and successful.

In the video below we can see the FPGA driving the RGB LED (There are other things on the breadboard, which will become relevant in the upcoming tutorials).
Final notes: All in all these small Lattice FPGAs are ideal for people who are getting started with FPGA design. The small PCB (breadboard friendly) with minimal components and cost further improves the possibilities. In the upcoming tutorials, we will see, that this little beast can also shine in more complex tasks such as in need of DSP/Control HW acceleration, or soft processing.