FPGA vs microcontroladores: outra abordagem para design embarcado

FPGA vs microcontrollers: another approach to embedded design

Most engineers begin embedded systems training by learning about microcontrollers. Microcontrollers wrap a complete miniature computing system on a single integrated circuit. The CPU, RAM, ROM, and input/output peripherals are on a single thumb-sized system on a chip (SoC) – the integrated circuit that comprises all or most of the electronic components.

In addition to components, another part of embedded design is related to software development. Microcontrollers (and microprocessors) have an instruction set that remains fixed in size and operation, meaning that an engineer uses the same instructions via assembly language or embedded C to solve a computing task, typically for a real-world application.

The good news is that working with microcontrollers is relatively simple to learn, given experience with programming languages. Popular versions such as AVR, 8051, PIC, and ARM expose engineers to the software development aspect of embedded systems. So, there are several options.

However, there is also another approach to embedded software development that microcontrollers are not capable of: hardware-based embedded design. For this, a field programmable gate array (FPGA) is required.

FPGAs were invented by Xilinx in 1984. They are integrated circuits that contain millions of logic gates that are electronically configured to perform specific tasks (i.e., the gates are field programmable).

Let's compare an FPGA to a computer. The computer (which can be a microcontroller, microprocessor or graphics processor) is a digital electronic circuit that performs tasks based on a set of instructions. These instructions contain machine codes that are implemented by the computer's digital circuit into data, where the data is stored and manipulated in registers or memory chips.

Alternatively, an FPGA takes the design to the hardware, so that an engineer can design a (simple) computing device at the architecture level to perform specific tasks or applications.

Field Programmable Gate Array (FPGA)

Microcontrollers versus FPGAs

Although an FPGA is often used to design digital circuits to perform simple computational tasks, it does not compare to a microcontroller in terms of computation. Microcontrollers and microprocessors are true computing devices with complex architecture.

An FPGA is comparable to and can work with application-specific integrated circuits (ASICs). An ASIC is customized for a specific task rather than for general use. In fact, any ASIC function can be custom designed and manufactured on an FPGA.

While microcontrollers allow engineers with assembly experience or high-level programming language design software for a computer, an FPGA allows the design of a simple computing device. This hardware-based embedded design requires detailed knowledge of digital circuits and computer architecture.

Some differences in language:

  • Microcontrollers are programmed using an assembly or high-level language (such as 'C'), which is converted into machine code for execution on a CPU.
  • FPGA chips are programmed using Verilog or high-speed integrated circuit hardware description language (VHDL). VHDL is converted into digital logic blocks manufactured on FPGA chips to design a custom computer for specific applications. Using VHDL or Verilog, an engineer designs the data path and arithmetic logic unit (ALU) hardware from the root level. Even a microcontroller can be designed on an FPGA, as long as there are enough logic blocks to support the design.

It makes sense to learn about microcontrollers and microprocessors first because it is important to understand how computers work and are programmed to perform specific tasks. Microcontrollers, FPGAs and CPLDs (complex programmable logic devices) are independent embedded systems with their own advantages and disadvantages.

FPGAs extend this knowledge to hardware circuits, with knowledge about how computers are built.

Advantages of FPGAs
FPGAs not only serve as a way to learn about digital design and computer architecture, but these chips also offer real-world applications in embedded systems engineering. They provide an alternative to ASICs, with certain advantages…

Multi-threading. FPGAs can process multiple instructions at the same time or in parallel. This is a big advantage over microcontrollers, which can only execute one instruction at a time, sequentially. This means that FPGAs are typically much faster at processing tasks. Because these processes are logically encoded at the hardware level, FPGA chips are ideal for dedicated or specialized applications, including sensor data preprocessing, cryptography, logic circuit design, digital audio applications, video streaming, and more.

Microcontrollers, on the other hand, have a generic architecture with a dedicated instruction set, which makes them better suited for solving complex computational tasks at slower speeds that may require standard interfaces.

Overall, FPGAs have an advantage when the volume of data to be processed in an application is high, thanks to this multithreading feature. Today, FPGA boards are available with integrated CPUs, so only the design logic is needed for application-specific processing.

Flexibility and scope of design. Any digital circuit, regardless of complexity, can be designed on an FPGA, as long as the chip contains a sufficient number of logic blocks to emulate the design. So, technically, FPGAs can be used to design any peripheral or perform any computational task.

They can also be programmed to have multiple timers, channel UARTs, or channel pulse-width modulation (PWM) generators — unlike microcontrollers, which do not offer this flexibility. This is because there is no way to change a microcontroller's chipset to suit an application. Instead, they have a generic computing unit and integrated peripherals (such as timers, GPIO, interrupts, and serial interfaces).

This flexibility of FPGAs gives engineers greater power for specialized projects.

Analog factor. Typically, in any embedded system, the controller or processor is coupled with sensors that provide analog input or actuators that require analog output from the controller or processor.

Field programmable analog arrays (FPAA) are also an option that allows designers to program complex analog circuits. Many FPGA chips include FPAAs, so the chip can be programmed into a digital circuit and process analog signals. These mixed-signal chips contain analog-to-digital converter (ADC) or digital-to-analog converter (DAC) peripherals, coupled with analog signal conditioning blocks.

The output pins on such devices can be programmed for drive force and slew rate as required by the load on that pin. This is another example of how FPGAs offer greater flexibility, with the ability to offer analog programming for specific applications.

Reuse. FPGAs can be reprogrammed to emulate any other digital (or analog) circuit, so a circuit is never fixed. When the chip is turned on, the digital design according to the configuration data is loaded into the chip. This happens every time the chip is turned on.

The configuration data can be changed for the next match with a new design. Because the chip is reusable, an engineer can endlessly experiment with different digital designs on the same chip.

Single chip solution. FPGAs offer a single-chip solution for an application. This is different from microcontrollers which must typically interface with other peripherals (which may not be integrated), interfaces or ASICs.

Real-time processing. FPGAs are not generic computing ICs but are used to design a dedicated computing device on the chip. Unlike microcontrollers, which execute a program (machine code), data paths and ALU are manufactured on the FPGA to solve a computational task.

This means that instead of executing a program, the FPGA is programmed to operate for a specific task. This execution of logic at the hardware level allows for real-time processing of data and information. This is why FPGAs are often used for high-speed critical applications where a microcontroller can fail due to its reliance on code to run on a fixed architecture with a limited instruction set.

~

Given these advantages, FPGAs are ideal for high-speed parallel processing where the volume of data to be processed is large or the processing chip requires custom peripherals, configurable analog output, or a dedicated time-critical application (which otherwise way would not be possible on a generic CPU).

FPGAs provide access to complex integrated designs that would otherwise only be available at a high engineering cost. This chip is like a mini semiconductor foundry on a credit card-sized board.

In real-world applications, FPGAs are used in specific verticals where production volume is low. It is widely used in prototyping ASIC designs, typically offering a quick time to market without a lengthy manufacturing process.

Common applications include digital signal processing, image processing, bioinformatics, cryptography, software-designed radios, medical imaging, speech recognition, telecommunications, data centers, aerospace electronics, and security systems.

In comparison, microcontrollers are used in general embedded applications such as automotive, consumer and industrial electronics, communication systems and others.

Disadvantages of FPGAs
There are some significant disadvantages related to FPGAs, depending on the application. These include complexity, high power requirements, and price.

Cost – FPGA boards are more expensive than microcontrollers (around $50 compared to $10 or less). This is one reason why FPGA chips are typically not discussed at the beginning of an embedded design training course.

However, FPGAs are reusable, which gives them greater long-term value, especially for research and development or prototyping purposes. In other cases, despite the slow speeds and generic architecture of microcontrollers, they are often just more affordable.

FPGA development board

An FPGA development board.

High power requirement. Most FPGA boards are powered by a 48V backplane. Unfortunately, the high power requirement makes them unsuitable for many embedded applications. Compare this to microcontroller boards, which typically only require a 5 or 3.3 V supply for operation. They are the obvious choice for the design of any battery-powered portable embedded device.

Volatility. The digital design of an FPGA is passed to it through configuration data. When turned on, the card is configured appropriately and begins operating. Configuration data must be stored in flash memory in master mode or passed through a processor through a boundary scan interface (JTAG) in slave mode. This data is lost when the card is turned off.

The volatile nature of most FPGAs makes them unsuitable for applications where there is a risk of power loss or interruption.

Startup time. FPGAs must load configuration data every time they are powered on. This adds significant startup time to your operation. However, once configuration data is loaded, an FPGA board typically operates much faster than a microcontroller.

Boot time can be an issue for certain critical applications that require immediate action upon activation. FPGAs are not suitable for applications where the embedded device turns on and off frequently. It is also not possible to keep these chips continuously powered on in an embedded device due to their high power consumption.

High pin count. In general, most FPGAs have multiple pins. Therefore, these chips are not ideal for small spaces or constrained embedded applications where the processor or computing controller must be compact. In contrast, there are many microcontrollers with eight pins or less that fit easily into small devices.

Complexity. Working with FPGAs requires detailed knowledge about digital design and computer architecture. It's not as simple as with microcontrollers. The languages ​​for FPGAs – VHDL or Verilog – are quite complex to learn compared to the high-level programming or assembly language required for software development.

Although most FPGA development tools are freely available, they are complex to use and choosing the ideal board can be difficult. There are also many complications, pitfalls, and cautions in digital design that can only be learned over time and with practical experience.

Project limitations. It is only possible to interconnect the logic blocks for a digital project with FPGAs. There is also no gate-level control, and typically the synthesis is non-standard. However, FPGAs are excellent for architectural testing or for an early-stage ASIC design.

Durability. FPGA ICs have a short lifespan compared to microcontrollers. While microcontrollers can last decades in a device, an FPGA chip in an embedded device typically requires replacement every two to five years.

The high cost, pin count, and power requirements, as well as complexity, volatility, and design limitations have made FPGAs less common in embedded applications. Currently, they are only used in high-power devices that require a dedicated architecture, custom peripherals, or critical machine code execution through parallel processing.

Conclusion
FPGAs have advantages and disadvantages. It depends on the application. In general, they give engineers greater access to hardware design and the ability to explore integrated circuits, which is impossible with microcontrollers. But this requires a certain level of knowledge and experience. It may be worth gaining a thorough understanding of embedded design engineering.

While microcontrollers and processors provide software expertise, FPGAs provide hardware expertise. And just like after creating code from scratch, experience makes everything easier over time.

Conteúdo Relacionado

What is the role of automotive sensors in modern vehicles?
A network of sensors is embedded in every vehicle,...
How to choose an e-bike controller
The motor controller is one of the most important...
How to Troubleshoot Common ESP32-CAM Problems
ESP32-CAM is a compact camera module that combines the...
A guide to USB standards from 1.0 to USB4
A evolução dos padrões USB foi fundamental para moldar...
Schurter aprimora série de seletores de tensão com revestimento prateado
A SCHURTER anuncia um aprimoramento para sua conhecida série...
A interface serial PCI fornece conectividade confiável em ambientes extremos
A Sealevel Systems anuncia o lançamento da Interface Serial...
STMicroelectronics expande portfólio de conversão de energia com diodos Trench Schottky de 100 V
A STMicroelectronics introduziu Diodos retificadores Schottky de trincheira de...
O que são Sistemas Globais de Navegação por Satélite (GNSS) e como são usados?
Determinar uma localização precisa é necessário em várias indústrias...
O conversor GaN de 50 W da STMicroelectronics permite projetos de energia de alta eficiência
O novo VIPerGaN50 da STMicroelectronics simplifica a construção de...
Samsung e Red Hat farão parceria em software de memória de próxima geração
A Samsung Electronics, fornecedora de tecnologia de memória avançada,...
Primeiro MPU single-core com interface de câmera MIPI CSI-2 e áudio
O mercado embarcado tem uma necessidade de soluções de...
A influência de diferentes enrolamentos de armadura CC no desempenho
O impacto dos enrolamentos da armadura CC no desempenho...
Fluency decoding in induction motor for better performance
You have probably come across the term ' drag...
Understanding Support Insulators in Electrical Systems
You probably have a support insulator if you've noticed...
Explore Stay Insulator – safety, installation and maintenance
You've probably seen stand an insulator sit on power...
More safety and efficiency with the shackle isolator
You've probably seen shackle insulators enthroned on electricity poles,...
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.