ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT HEADS ASSOCIATION

September 2014

Featured Article

The Right Tool for the Job: MCU, SBC, or FPGA?

By Mouser Electronics

Choosing the right platform is similar to the picking the right hand tool from your toolbox.  Though there is typically enough crossover of functionality between different types of tools, some are better for certain tasks than others.  With increasingly more variety of affordable embedded hardware tools coming to market, many are starting to ask, “What’s the right tool for the job?”

Microcontrollers (MCU), Single Board Computers (SBC) and Field Programmable Gate Arrays (FPGA) are three different types of electronics platforms that each has their own pros and cons depending on use.  In the open source world of MCU platforms, the Arduino is arguably the current king.  Some noteable SBCs are the Intel NUC and the BeagleBone Black. The Intel NUC is a single board computer with a 1.3GHz CPU, that is essentially a barebones desktop ready for a Linux distribution such as Mint, Fedora, or Ubuntu. FPGAs are just starting to get “the maker touch[i] with the advent of the Papilio and the Mojo.  These various boards physically look quite similar at a casual glance, but reality is much more complicated. Let’s take a look at each type of platform and discuss the use cases for each.

Microcontrollers:  MCUs are perhaps the simplest (for better and for worse) of the three devices.  Microchip’s PIC and Atmel’s AVR microcontroller chips are two major players in the MCU space. Arduino boards have mostly employed AVR chips and make programming easy by including a bootloader that allows your computer and Arduino to talk and install sketches directly.  Traditionally, an MCU chip would need to be first placed into a hardware programmer to receive the code it executes then placed into the circuit board it will be controlling.  Life is better now! 

Most popular MCUs used in the maker community tend to be single core processors, meaning only one program can run. The program with its one main loop begins as soon as the power is applied.  It runs with no operating system, no drivers, and no complexity.  There are some multicore MCUs such as the Parallax Propeller that let you handle running multiple concurrent loops.

The simplicity means MCU packages can be small and cheap.  But you may find their functionality limited by the single-program execution.  Another differentiator is whether or not MCUs are capable of analog I/O via analog-to-digital converters and pulse-width modulation.

If you need to interface with the real world but are not doing much computation-intensive work with sensor data, and you are looking to keep costs and complexity low, then an MCU is a good choice.  If you are looking to go into production with your device, consider creating a custom printed circuit board (PCB) instead of using a pre-built MCU platform like an Arduino.  You can remove unneeded components, customize the physical layout of the board, and achieve significant cost savings once you start purchasing components in bulk.  Many projects start with something like an Arduino board for prototyping then move to custom PCBs for manufacturing.

 

Single Board Computers:  Fundamentally, SBCs are no different than full-blown desktops/ laptop computers.  They lack raw horsepower in terms of processor capability, RAM, storage, or graphics capability; but they are computers nonetheless, complete with an operating system (OS), typically a Linux distribution.  However,  you have an OS-powered environment at a very affordable price.

This can be both a blessing and curse.  For example, interfacing with complex devices such as a webcam can be as easy as downloading an application and installing it just like any regular computer.  If your OS has an appropriate compiler, then you can tailor and run most open source programs if you get a hold of the source code.  This is the power of open source hardware and software!  On the flip side, you may find that having a fairly robust OS means doing things like interfacing with the General Purpose Input/Output (GPIO) to be slightly more cumbersome as compared to doing similar functions on an Arduino.  Also, since there is an OS running, it is performing certain functions (e.g. memory management) in addition to running your code.  Therefore, real-time applications can be an issue unless you are running a specialized Real-Time OS (RTOS).


Figure 1: The Intel NUC is a single board computer with a 1.3GHz CPU.
http://www.mouser.com/new/Intel/intel-NUC-Core-i5-4250U/

If your application is going to require rather intensive computing or you need/want to use a specific programming language such as Python, then an SBC is a better choice.  Be careful though; some SBCs such as the Raspberry Pi have GPIO pins that are only 3.3V tolerant, unlike most Arduinos where 5V is the norm.  You can fry your board or a GPIO pin by connecting to a higher voltage.  Also, making a device that talks to the Internet is traditionally a bit easier with an SBC.  Analog input (AI) tends to be more hit-or-miss on SBCs, so read datasheets carefully.  While the BeagleBone Black has seven AIs, the Raspberry Pi has no hardware AIs.  You can compensate for the lack of dedicated analog hardware using an RC circuit and measuring capacitor discharge time.  There are also external ADC chips that can be connected via a serial communications protocol such as I2C.  




Figure 2: The Altera Cyclone III FPGA Starter Board (http://www.altera.com/literature/manual/rm_ciii_starter_board.pdf)

http://www.mouser.com/new/altera/altera-cycloneiii/

Field Programmable Gate Arrays:  FPGAs can be a difficult concept to grasp initially for many, which is why they’re just starting to get the same open source treatment that Arduino and BeagleBone Black did for their respective platforms. Unlike an MCU or SBC, you do not program an FPGA in the traditional sense.  You use a Hardware Description Language (HDL) such as Verilog or VHDL to create “code” that is visually similar to software but performs a very different function.  While software provides a set of instructions to execute on hardware, an HDL tells the FPGA how to configure its internal circuitry.  You can even go so far as to build a complete processor in an FPGA and run the Arduino bootloader, thus creating an AVR microcontroller in your FPGA and customize it.  In addition to this “blank canvas” appeal, other major advantages of FPGAs are speed and the ability to handle parallel I/O without need for interrupts, which single core MCUs need in order to deal with asynchronous events.

If an application needs to be very fast and handle multiple parallel I/O simultaneously, then an FPGA is probably the way to go.  It does come with a lot of learning overhead but if you are serious about making a production-worthy product, then designing and testing on an FPGA is wise. The same HDL “code” can be used when you’re ready to set the design “in silicon” in an Application Specific Integrated Circuit chip (ASIC). 

Wrapping Up

The above highlighted some differences between MCUs, SBCs, and FPGAs.  In reality, the lines between them are blurring, especially in the case of the SBC and MCU with the advent of hybrid tools like the Arduino Yun and Tre.


[i] http://en.wikipedia.org/wiki/Maker_culture


 
 Follow ECEDHA on Twitter
 


 

View the latest issue!
‚Äč

On Demand Webinars
From Concept to Communications: Putting the
ECEDHA Brand Toolkit to Work

In partnership with Tailfin Marketing
 
New Tools for State of the Art Research and
Industry-Ready Students
Sponsored by Keysight Technologies
 
A Case Study on Connected Maintenance Reliability
Sponsored by Fluke Corporation
 
Rethinking Electronics Fundamentals
Sponsored by National Instruments
 
Oscilloscopes for the Classroom
Sponsored by Keysight Technologies

E-mail the event date, name and link to information@ecedha.org to be added to the calendar.

July 25
2019
Great Lakes Regional Meeting 
University of Illinois at Chicago - Chicago, IL

October
TBD
Northwest Regional Meeting
UMass Lowell - Lowell, MA

March
18-21, 2020:

 2020 ECEDHA Annual   Conference and ECExpo
 Renaissance Orlando Sea   World -  Orlando, FL

Support ECE education! 
Become an ECEDHA Corporate Sponsor

Exhibit and sponsorship opportunities for 2019 are now available!


>> View Sponsorship Prospectus

Contact Kim Simpao
for more information
+1-773-315-7779 (mobile)
ksimpao@ecedha.org

Corporate Members


 


 

 
 


 

 

 

 
 



 Mouser

National Instruments 

 quanser

 
 

 Texas Instruments