Tackle Computationally Intensive Projects with the ShieldBuddy
Original Title：Tackle Computationally Intensive Projects with the ShieldBuddy
Many hobbyists, makers, and DIYers use Arduino microcomputer development boards to monitor and control their projects. So, too, do an increasing number of professional engineers who may use these boards as evaluation and prototyping platforms to accelerate development and lower the costs associated with evaluating integrated circuits (ICs), sensors, and peripherals. As was discussed in Use Arduino BOBs to Quickly Evaluate Sensors and Peripherals, these engineers may be working in smaller teams with tighter time to market (TTM) constraints. As such, they have had to embrace multiple engineering domains and tasks, while finding ways to accelerate and lower the cost of component evaluation.
One solution is to use Arduinos along with open source hardware in the form of sensor and peripheral breakout boards (BOBs) in conjunction with open source software with associated libraries and example programs. While there is a wide variety of Arduino boards to meet a range of processing and memory requirements, some calculations are nonetheless better done using a floating point unit (FPU) to avoid slowing down the main processor. This problem has been addressed within the Arduino ecosystem by the ShieldBuddy.
This article will describe various Arduino processing platform options and why FPU capability is so important for many applications. It will then introduce the ShieldBuddy, a board that maintains a similar physical footprint to Arduino boards, but has three independent 32-bit processing cores, each running at 200 MHz and each having its own FPU. The article will describe its programming model and show how its Eclipse-based programming environment and its support of Arduino’s integrated development environment (IDE) enables DIYers and designers alike to quickly get started with it.
Arduino for newcomers and professionals alike
Newcomers to the Arduino universe typically start with the Arduino Uno Rev3 (Figure1), which is based on the 8-bit ATmega328P microcontroller running at 16 megahertz (MHz). This board has only 32 kilobytes (Kbytes) of flash (program) memory, 2 Kbytes of SRAM, 14 digital input/output (I/O) pins, and six analog input pins. Six of the digital pins can provide pulse width modulation (PWM) outputs, and the analog pins can also be used as digital I/O pins, if required.
Figure 1: The Arduino Uno Rev3 development board is based on the 8-bit ATmega328P microcontroller running at 16 MHz. (Image source: Arduino.cc).
The footprint of the Arduino Uno Rev3’s headers, with 14 digital I/O pins, 6 analog input pins, and various, power, ground, and reference pins, is the basis for an enormous ecosystem of daughterboards called shields.
Many users of the Uno Rev3 subsequently progress to the Arduino Mega 2560 Rev3 board (Figure 2), which is based on the 8-bit ATmega2560 microcontroller running at 16 MHz. This board has 256 Kbytes of flash memory and 8 Kbytes of SRAM. The footprint of its headers means it can support the same shields as the Uno, however, additional headers allow it to fit 54 digital I/O pins and 16 analog input pins. In this case, 15 of the digital pins can provide PWM outputs, and—once again—the analog pins can also be used as digital I/O pins, if required.
Figure 2: The Arduino Mega 2560 Rev3 development board is based on the 8-bit ATmega2560 microcontroller running at 16 MHz. The footprint of its headers means it can support the same shields as the Arduino Uno, but it also has additional headers, providing a total of 54 digital I/O pins and 16 analog input pins. (Image source: Arduino)
In addition to the limitations imposed by an 8-bit data path and a 16 MHz clock, neither the Arduino Uno nor the Arduino Mega microcontrollers include an FPU, which means any calculations involving floating-point values dramatically slow these processors.
For those users wanting even more processing power, the next step up is the Arduino Due (Figure 3), which has a similar physical footprint to the Arduino Mega, but which is based on the 32-bit Atmel/Microchip Technology SAM3X8E Arm® Cortex®-M3 processor running at 84 MHz. This board has 512 Kbytes of flash memory, 96 Kbytes of SRAM, 54 digital I/O pins, 12 analog input pins, and two analog output pins which are driven by digital-to-analog converters (DACs). In this case, only 12 of the digital pins can provide PWM outputs, and—once again—the analog pins can also be used as digital I/O pins if required. Unfortunately, like the Arduino Uno and Mega, the Arduino Due’s processor does not include an FPU.
Figure 3: The Arduino Due development board is based on the 32-bit Atmel SAM3X8E Arm Cortex-M3 processor running at 84 MHz. The footprint of its headers is identical to that or the Arduino Mega. (Image source: Arduino.cc)
Many users—both hobbyist and professionals alike—enjoy the high pin counts of the Arduino Mega and Arduino Due development boards. But, even the Arduino Due’s 32-bit processor running at 84 MHz may be insufficient for some computationally intensive tasks. Similarly, the Due’s 512 Kbytes of flash memory and 96 Kbytes of SRAM may be insufficient for more substantial programs working with large amounts of data.
While microcontrollers are able to handle the processing of increasingly large amounts of data, some computations are better done using FPUs for greater efficiency and lower latency.
What are FPUs and why are they needed?
The reasons FPUs are useful goes back to how computers handle numbers. The simplest way to represent numbers inside computers is to use integers (whole numbers). Also, performing computations using integers is computationally inexpensive. However, integers are finite in nature and cannot express a wide dynamic range.
This is problematic for engineers and scientists as they often need to use extremely large and small values in the same calculation. For example, physicists may have calculations that employ the numeric values of the speed of light (300,000,000) and Newton’s gravitational constant (0.00000000006674). Similarly, engineers require values with a large dynamic range for tasks like digital signal processing (DSP), and for use in artificial intelligence (AI) and machine learning (ML) applications.
The solution is to use floating-point numerical representation, where the decimal point can “float” with respect to the individual digits of the number, allowing a finer degree of numerical “resolution” to be achieved. The problem is that although a 32-bit floating-point value consumes the same amount of memory as a fixed-point 32-bit integer, performing calculations using floating-point values requires substantially more computational resources.
If the processor is obliged to perform floating-point calculations using standard fixed-point hardware, the result will be to dramatically impact that processor’s performance. The solution is to equip the processor with a special FPU. Doing so allows the execution of sophisticated floating-point operation using very few clock cycles.
This is where the ShieldBuddy comes into play.
ShieldBuddy brings FPUs and high performance to Arduino ecosystem
A relatively new player in the Arduino compatible space, Infineon Technologies' KITAURIXTC275ARDSBTOBO1, or ShieldBuddy (Figure 4), is an embedded evaluation board for Infineon’s TC275T64F200WDCKXUMA1 TC275 AURIX TC2xx TriCore 32-bit microcontroller.
Figure 4: The ShieldBuddy TC275 is fitted with the Infineon TC275 32-bit multicore processor on a board with the same footprint as the Arduino Mega and Arduino Due, making it compatible with many of the application shields that are available. (Image source: Hitex.com)
Maintaining a similar physical footprint to the Arduino Mega and Arduino Due, the ShieldBuddy is compatible with many of the application shields, but it is distinguishable by its use of the TC275 with its three independent 32-bit cores, each running at 200 MHz and each having its own FPU. Furthermore, the ShieldBuddy has 4 megabytes (Mbytes) of flash memory (8x that of the Arduino Due and 16x that of the Arduino Mega) and 500 Kbytes of RAM (5x that of the Arduino Due and 62x that of the Arduino Mega).
One way to look at this is that the Arduino Mega’s core manages only around sixteen 8-bit instructions per microsecond (µs). By comparison, each of the TC275’s cores have a 5 nanosecond (ns) cycle time, which means each core can typically execute around 150 to 200 32-bit instructions/µs. As each of the ShieldBuddy’s processor cores has its own FPU, the board can perform floating-point calculations with little, if any, degradation in performance.
Developing with the ShieldBuddy
When working with the ShieldBuddy, professional software developers may wish to use an Eclipse IDE, while hobbyists and makers may prefer to use the familiar Arduino IDE. Both options are supported.
Users of the Arduino will be familiar with the fact that each sketch (program) must have two standard functions: setup(), which is run a single time, and loop(), which is run over and over again. Users can also create their own functions.
The ShieldBuddy’s three cores are called Core 0, Core 1, and Core 2. In the case of the Arduino IDE, most existing sketches can be compiled for use on the ShieldBuddy without modification. By default, the setup() and loop() functions—along with any user created functions they call—will be compiled to run on Core 0.
When creating a new program, the user can achieve the same effect by naming these functions setup0() and loop0(). The user can also create setup1() and loop1() functions, which—along with any user created functions they call—will automatically be compiled to run on Core 1. Similarly, setup2() and loop2() functions, along with any functions they call, will automatically be compiled to run on Core 2.
By default, each core runs independently, which means it’s possible to have three totally separate programs running on the ShieldBuddy simultaneously. Having said this, the cores can also communicate between themselves using techniques like shared memory. Furthermore, each core can trigger soft interrupts in the other cores.
The open source Arduino concept has proved to be tremendously successful, and the ensuing hardware and software ecosystems have grown to encompass hundreds of shields and thousands of libraries and applications.
Although early Arduino development boards, like the 8-bit, 16 MHz Arduino Uno and Arduino Mega were somewhat limited, more recent implementations like the 32-bit, 84 MHz Arduino Due are significantly more powerful. Even so, many users require more program space (flash), more data space (SRAM), and more processing power than any traditional Arduino can offer.
With 4 Mbytes of flash memory, 500 Kbytes of SRAM, and three independent 32-bit processor cores running at 200 MHz, each with its own FPU, the ShieldBuddy takes the Arduino concept to a whole new level, making it of interest to extreme DIYers and professional engineers alike.
KEY COMPONENTS TABLE
1.The content, data, charts, etc. of this article come from network reference or other public materials, and the copyright belongs to the original author and the original published source. If the copyright owner has any objection to the quotation of this article, please contact ICZOOM "marketing(at)iczoom.com" and we will deal with it in a timely manner.
2.The quotes in this article are for readers' learning exchange only, and do not involve commercial purposes.
3.The content of this paper only represents the author's point of view. ICZOOM cannot gurarante and assure the accuracy, reliability or integrity of the content. The decision or behavior made by readers after reading this article is based on their own will and independent judgment. Please clarify the relevant results before reading this article.
4.Please contact ICZOOM "marketing(at)iczoom.com" with the reason of reproducing if you want to reproduce the articles that ICZOOM owns the copyright. Without permission to reproduce, ICZOOM will reserve the right to pursue the legal liability.
5. If there is any inconsistency between the English and Chinese versions, the Chinese version shall prevail.
ICZOOM has the final right to interpret this statement.