In the beginning, there were processors…

Welcome to our series of posts on FPGA’s! Electronics right now is one of the most fascinating and also most divergent subjects around. You can get engineers specialised in RF (Radio Frequency), precision analogue, power, embedded systems and more.

There is one big trend however that runs straight through the middle of every skill set: digital processing and software.

RF has SDR’s (Software Defined Radio’s), precision analogue has ever more complex control processed digitally in some way, power has SDPSU’s (Software Defined Power Supplies) and embedded systems, well, that speaks for itself… The reason for all of this? The price and performance of computing power nowadays is like nothing ever seen before.

Although clock rates don’t tell the whole story and peripheral sets are different, in the late 90’s you could buy a 200MHz Pentium II processor for your home PC at around $600. Now, in 2018, you can buy a 200MHz PIC32MZ microcontroller for around $8. That’s roughly two orders of magnitude difference in price over two decades!

a Microcontroller electronic component

The Humble Microcontroller

This is great news for anyone looking to implement microcontrollers and they’re now taking over more of the old tasks in traditional veins of electronics design for that exact reason.

There are some things that they still can’t do too well though. Microcontrollers are rigid in hardware terms, and price soon blossoms if you start to look for microcontrollers with a lot of fancy peripherals (bit bashing can get you around so much, but not everything).

They’re also not the best at doing things in parallel because, well, they’re processors after all; they take one instruction at a time. They’re also much more non-deterministic most of the time and they can’t handle tight timing control.

There is a type of device however that solves all the problems that the microcontroller has: the FPGA (Field Programmable Gate Array).

Let there be FPGA’s…

FPGA’s feature in a high percentage of products currently without anybody noticing them. Whether it’s the newest VR headset on the market or the racks full of cards at telephone exchanges; they are a crucial element in modern day electronics.

FPGA’s are essentially a fabric full of logic and memory ready to be defined how to be connected together to perform whatever function is needed.

They’re different from microcontrollers in the sense that they aren’t a piece of silicon hardwired into the form of a processor that executes instructions dictated by the software you write, they become the HDL (hardware description language) that you describe. I know, it’s weird, but trust me when I say that they are an essential part of the engineering toolbox when it comes to solving complex problems in electronics.

Stage 1: Define the hardware needs

In this series of posts we’re going to implement an FPGA onto a board so that we can experiment with different ways of using the device. To do so we need to select an FPGA to use and all the circuitry needed in order to get one up and running.

Selecting an FPGA

There are so many different types of FPGA on the market today that for anyone new to FPGA’s it can be a daunting prospect to pick the right one. The four main manufacturers of FPGA’s are Xilinx, Intel (previously Altera, which I’ll still refer to them as), Lattice and Microsemi, all of which have their own spin on things just to add to the confusion.

Microsemi and Lattice have their market space much better defined than Xilinx and Altera who battle it out as the biggest manufacturers in the industry. A typical Microsemi FPGA sales representative will always highlight robustness and security as the main focus, whereas Lattice market the to the small/low cost end of things a lot more.

Altera and Xilinx try to cover the whole range with smaller CPLD (Complex Programmable Logic Device)/FPGA inexpensive devices with low pin counts and less features, all the way up to large expensive and feature rich FPGA’s.

For this design I’m going to be using a Xilinx part, and not because of any of the above (sorry for the red herring), but because of a new interesting way of sourcing previously exclusive components from China.

an Altera Cyclone FPGA (Field Programmable Gate Array) component on a circuit board

An Altera Cyclone

Over the past few years China has made a colossal impact on the electronics industry. Not only can you get PCB’s made for pence and turned around in days by just uploading some gerbers to a website, but also component prices have been hugely reduced.

This design is going to utilise both of these factors. I’m going to get my PCB made in China and I’m sourcing my FPGA’s from China too.

I’ve selected the Spartan 3A as my FPGA of choice, specifically the XC3S50A-4VQ100 due to the fact that these can be purchased in quantities of 10 for roughly £1 per part. For an FPGA, that is a fantastic price.

Why this one?

Spartan 3A’s are roughly 10 year old components. Although in electronics years that’s fairly old, the principals of their use are very similar to the examples of today and they’re still more than capable devices.

The device has the smallest amount of logic elements in the Spartan-3A family at 50k and is also the smallest package, which is only natural with the price we’re being charged for them. The small pin count and package type is intentionally useful in our circumstances because this isn’t going to be a mass produced design, we want to make it by hand.

With hand assembly being possible, this reduces our costs even more. The circuitry needed in order to get a Spartan-3A up and running is also relatively simple compared to the more typical big and beefy FPGA. FPGA’s usually require many different voltage rails for things like internal core voltages, bank I/O voltages and configuration bank voltages.