Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts

Click the blue text above to follow us!

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts
Many hobbyists, makers, and DIY enthusiasts use Arduino microcontroller development boards to monitor and control their projects. Consequently, more and more professional engineers are also starting to use these development boards as evaluation and prototyping platforms to accelerate development speed and reduce costs associated with integrating circuits (ICs), sensors, and peripherals. As discussed in the article “Quick Evaluation of Sensors and Peripherals Using Arduino BOB“, the teams these engineers belong to may be relatively lean and are constrained by the ever-shortening time to market (TTM). Therefore, they must take on multiple engineering disciplines while striving to speed up component evaluation and reduce costs.
One solution is to combine Arduino with open-source hardware like sensor and peripheral breakout boards (BOBs) and open-source software such as libraries and example programs. While there are various Arduino development boards that meet a range of processing and memory requirements, using a Floating Point Unit (FPU) can better handle certain calculations, thus avoiding the slowdown of the main processor. In the Arduino ecosystem, ShieldBuddy has already addressed this issue.
This article will introduce various Arduino processing platform options, explain why FPU functionality is important for many applications, and then introduce ShieldBuddy, a development board that has a similar physical package to Arduino boards but features three independent 200MHz 32-bit processor cores, each with its own FPU. Additionally, this article will present the programming model of this development board, demonstrating how its Eclipse-based programming environment and support for the Arduino Integrated Development Environment (IDE) help DIY enthusiasts and designers get started quickly.

Suitable for Beginners and Professionals Arduino

Newcomers to the Arduino field often start with the Arduino Uno Rev3 (Figure 1), which is based on the 16MHz 8-bit ATmega328P microcontroller. This development board has only 32KB of flash memory (program), 2KB of SRAM, 14 digital input/output (I/O) pins, and 6 analog input pins. Six of the digital pins can provide pulse-width modulation (PWM) output, and the analog pins can also be used as digital I/O pins when needed.

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts

Figure 1: The Arduino Uno Rev3 development board is based on the 16MHz 8-bit ATmega328P microcontroller. (Image source: Arduino.cc)

The pin header packaging of the Arduino Uno Rev3 serves as the foundation for connecting to a vast ecosystem of expansion boards, including 14 digital I/O pins, 6 analog input pins, and multiple power, ground, and reference source pins.

After Uno Rev3, many users switched to the Arduino Mega 2560 Rev3 development board (Figure 2). This board is based on the 16MHz 8-bit ATmega2560 microcontroller. It has 256KB of flash memory and 8KB of SRAM. Additionally, the board’s pin header packaging indicates that it supports the same expansion boards as the Uno, but the Mega has more pins, featuring 54 digital I/O pins and 16 analog input pins. Fifteen of the digital pins can provide PWM output, and the analog pins can also be used as digital I/O pins when needed.

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts

Figure 2: The Arduino Mega 2560 Rev3 development board is based on the 16MHz 8-bit ATmega2560 microcontroller. The board’s pin header packaging indicates that it supports the same expansion boards as the Arduino Uno, but it has more pins, totaling 54 digital I/O pins and 16 analog input pins. (Image source: Arduino)

Besides being limited by 8-bit data paths and 16MHz clock frequency, both the Arduino Uno and Arduino Mega microcontrollers lack an FPU, which means any calculations involving floating-point numbers will significantly slow down these processors.

If users want more processing power, they can upgrade to the Arduino Due (Figure 3). This development board has a similar physical package to the Arduino Mega but is based on the Atmel/Microchip Technology SAM3X8E 84MHz 32-bit Arm® Cortex®-M3 processor. The board has 512KB of flash memory, 96KB of SRAM, 54 digital I/O pins, 12 analog input pins, and 2 analog output pins driven by digital-to-analog converters (DACs). Among these, only 12 digital pins can provide PWM output; similarly, the analog pins can also be used as digital I/O pins when needed. However, unfortunately, like the Arduino Uno and Mega, the processor of the Arduino Due also lacks an FPU.

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts
Figure 3: The Arduino Due development board is based on the Atmel SAM3X8E 84MHz 32-bit Arm Cortex-M3 processor, with a pin header packaging similar to the Arduino Mega. (Image source: Arduino.cc)

Many users (including hobbyists and professionals) prefer the Arduino Mega and Arduino Due development boards for their numerous pins. However, even the 84MHz 32-bit processor of the Arduino Due may struggle with certain computation-intensive tasks. Similarly, for large programs that need to handle a lot of data, the 512KB flash memory and 96KB SRAM provided by the Due may still be insufficient.

Although today’s microcontrollers can handle a larger amount of data, using an FPU can better perform certain calculations in terms of improving efficiency and reducing latency.

What is an FPU? Why is it needed?

To discuss why FPUs are useful, we first need to talk about how computers process numbers. In computers, the simplest numerical representation is integer (whole numbers), and calculating with integer numbers is less costly. However, integer numbers are inherently limited in range and cannot represent larger dynamic ranges.

This poses a problem for engineers and scientists, as they often need to use extremely large and small values in the same computation. For example, physicists may need to use the speed of light (300,000,000) and the gravitational constant (0.00000000006674) in the same calculation. Similarly, in tasks such as digital signal processing (DSP) and applications in artificial intelligence (AI) and machine learning (ML), engineers must work with numbers that require a larger dynamic range.

In this case, the solution is to use floating-point representation, where the position of the decimal point can “float” based on the digits of the value, allowing for higher numerical “resolution”. However, the problem is that while a 32-bit floating-point number occupies the same memory as a 32-bit integer fixed-point number, performing calculations with floating-point numbers requires more computational resources.

If a processor must use standard fixed-point hardware to perform floating-point calculations, it will severely impact that processor’s performance. In this case, the solution is to equip the processor with a special FPU, which can complete complex floating-point calculations in a very short clock cycle.

This is precisely where ShieldBuddy comes into play.

ShieldBuddy Introduces FPU and High Performance to the Arduino Ecosystem

Currently, a relatively new Arduino-compatible development board is Infineon Technologies‘s KITAURIXTC275ARDSBTOBO1, known as ShieldBuddy (Figure 4). This embedded evaluation board is primarily aimed at Infineon’s TC275T64F200WDCKXUMA1 TC275 AURIX TC2xx TriCore 32-bit microcontroller.

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts
Figure 4: The ShieldBuddy TC275 is equipped with an onboard Infineon TC275 32-bit multicore processor and is compatible with many application expansion boards available on the market due to its similar packaging to the Arduino Mega and Arduino Due. (Image source: Hitex.com)

ShieldBuddy has a similar physical package to the Arduino Mega and Arduino Due, making it compatible with many application expansion boards. However, it is equipped with a TC275 that features three independent 200MHz 32-bit cores, each with its own FPU. Additionally, ShieldBuddy has 4MB of flash memory (8 times that of Arduino Due, 16 times that of Arduino Mega) and 500KB of RAM (5 times that of Arduino Due, 62 times that of Arduino Mega).

One notable difference is that the Arduino Mega core can handle about 16 eight-bit instructions per microsecond (µs); in contrast, the TC275 has a cycle time of 5ns, allowing each core to typically execute around 150 to 200 32-bit instructions per microsecond. Since each processor core in ShieldBuddy has its own FPU, the board can perform floating-point calculations with virtually no performance degradation.

Developing with ShieldBuddy

When using ShieldBuddy, professional software developers may prefer to use the Eclipse IDE, while hobbyists and makers might favor the more familiar Arduino IDE. The board supports both options.

Arduino users are well aware that each sketch (program) must have two standard functions: setup() (runs once) and loop() (runs repeatedly). In addition, users can create their own functions.

ShieldBuddy’s three cores are named Core 0, Core 1, and Core 2. In the case of using the Arduino IDE, most existing sketches can be compiled for direct use with ShieldBuddy without modification. The setup() and loop() functions, along with all user-created functions they call, are compiled to run by default on Core 0.

When creating new programs, users can name these functions setup0() and loop0() for the same effect. Additionally, users can also create setup1() and loop1() functions. These functions and all user-created functions they call will automatically run on Core 1 when compiled. Similarly, setup2() and loop2() functions and all user-created functions they call will automatically run on Core 2 when compiled.

By default, the cores operate independently, allowing ShieldBuddy to run three completely independent programs simultaneously. Nonetheless, the cores can also communicate using techniques such as shared memory. Furthermore, each core can trigger software interrupts in other cores.

Conclusion

It has been proven that the open-source philosophy of Arduino has achieved tremendous success, leading to the development of a hardware and software ecosystem that includes hundreds of expansion boards, thousands of libraries, and applications.

Although early Arduino development boards (such as the 16MHz 8-bit Arduino Uno and Arduino Mega) had certain limitations, newer products (such as the 84MHz 32-bit Arduino Due) are significantly more powerful. Even so, many users still require more program storage space (flash), more data storage space (SRAM), and more processing power—none of which any traditional Arduino can provide.

ShieldBuddy features 4MB of flash memory, 500KB of SRAM, and three independent 200MHz 32-bit processor cores, each with its own FPU, taking the Arduino philosophy to a whole new level, making it highly attractive to extreme DIY enthusiasts and professional engineers.

– END –
Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts
Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts

Featured Recommendations

Record Imports: Is Domestic Chip Replacement Possible?

Breaking the Aesthetic Ceiling of the Winter Olympics Opening Ceremony?

What to Watch for in the 2021 Electronics Supply Chain?

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts
Scan to Follow Us

Submission Email:

liutingting03@hc360.com

Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts
I knew you were “watching”Mastering FPU with ShieldBuddy: A Guide for Arduino Enthusiasts

Leave a Comment

Your email address will not be published. Required fields are marked *