Who Needs High-Performance MCU? (Arduino Portenta H7 vs Espressif ESP32-S3)

Introduction

In this article, we will compare the performance of two devices, H7 and S3, by conducting several tests. Both devices used the same code, which you can find in my GitHub repository. The aim of these tests is to evaluate the computational speed and efficiency of each device.

The YouTube Algorithm Recommends: A Comparison Between Portenta H7 and ESP32 S3

The YouTube Algorithm is always amazing. It clearly knows what I like. Among the videos it recommended, there was a video comparing Raspberry Pi Pico and ESP32 S2. It was enough to catch my eye and it was very interesting. If you are curious about that, you can find the video link in the video description below. Similar to this video, I’m trying to compare the Portenta H7, which is the Arduino Pro, with my favorite one, ESP32 S3 board made by Espressif. Let’s take a look at the specifications first.

Specifications:

Just by looking at it, the Portenta H7 has much more functionality than the ESP32 S3. But the problem is the price. This is always the biggest problem. The H7 is now available for $113, while the S3 Devkitc costs only $15. There’s a huge price difference. Most people, including me, will hesitate to buy this. Do I really need this? It’s too over-spec for my project. We know it’s normal to think like this.

Comparison of MCUs Cores:

In this video, I’m going to compare the MCUs’ cores first. The H7 consists of an Arm Cortex M7 operating at 480 MHz and a low power M4 operating at 240 MHz. The S3 has a dual-core 32-bit LX7 operating at 240 MHz. So, let’s look at how good the H7 is compared to S3. This test compares the computational speed of the two MCUs when running a single task. The algorithm used here is the Leibniz Formula, and the higher the number of iterations, the closer to the actual pi value.

Performance Test:

To evaluate the performance of the H7 and S3, we will run the Leibniz Formula with increasing iterations and measure the time taken by each MCU to calculate the approximate value of pi. The results are as follows:

For 1 million iterations:

– Portenta H7: 5 seconds

– ESP32 S3: 7 seconds

For 10 million iterations:

– Portenta H7: 46 seconds

– ESP32 S3: 68 seconds

From these results, we can see that the H7 performs better than the S3 in terms of computational speed. However, it’s important to note that the difference in performance may not be significant for most projects.

Additional Features:

Aside from the computational power, the Portenta H7 offers additional features such as a built-in graphics accelerator, Ethernet connectivity, and a crypto engine. These features make it suitable for more complex projects that require advanced graphics rendering or secure communication protocols. On the other hand, the ESP32 S3 focuses more on providing a cost-effective solution with sufficient processing power for most IoT applications.

:

The Portenta H7 and ESP32 S3 have their own strengths and weaknesses. The H7 offers superior computational power and additional features, but comes at a higher price point. On the other hand, the S3 provides a more affordable option with sufficient performance for most projects. When choosing between the two, it’s important to consider your specific

The Performance Comparison: H7 vs S3

Display Performance

The LCD used in both devices is the same Ili9341 3.2 inch, 320X280 display. Interestingly, H7 performs better when it comes to drawing the screen through SPI. However, it’s important to note that the GFX library has not been optimized for Mbed OS Portenta, which is the architecture of H7. Therefore, the time required to draw the screen is subtracted when calculating the elapsed time.

Computational Speed

To test the computational speed, we conducted a task that involved performing 10 million iterations to obtain the value of pi with a high accuracy. The results were astounding. H7 completed the task in approximately 6 seconds, yielding a pi value with an error of only 0.0000001. On the other hand, S3 took around 37 seconds to complete the same task. This time difference is significant, considering that the clock speeds of the two devices are only twice as different. It is clear that H7 outperforms S3 in terms of computational speed.

Finding Prime Numbers

Next, we decided to test the performance of both devices in finding prime numbers between 1 and 300,000. As the number got higher, the algorithm became noticeably slower. However, it is important to mention that if the algorithm were optimized, the task may be completed faster. Nevertheless, the difference in performance still applies to both H7 and S3.

Results

After conducting the prime number test, we found that there are 25,997 prime numbers between 1 and 300,000. H7 took approximately 51 seconds to complete the task. Considering the performance of H7 so far, we can expect S3 to take a considerably longer time. To save time, the video was sped up during S3’s task. Finally, S3 completed the task in about 79 seconds and also found the same number of prime numbers as H7.

Dual Core Processors: An Overview

Dual core processors have become increasingly popular in recent years due to their ability to significantly enhance computing capabilities. These processors consist of two independent cores that can execute tasks simultaneously, providing improved performance and speed. In this article, we will examine the functioning and performance of dual core processors, focusing on the H7 and S3 models.

Physical Separation of Cores

One key feature of the H7 dual core processor is the physical separation of its cores. This means that the two cores are not interconnected and operate independently. Essentially, it is like having two separate microcontroller units (MCUs) on a single board. As a result, the code must be uploaded to each core individually.

Independent Operation and Data Exchange

The dual cores of the H7 processor are capable of operating independently from each other. They can send and receive data through a mechanism called Remote Procedure Call (RPC). On the other hand, the S3 model operates based on FreeRTOS and typically exchanges data through a Queue.

Testing the Performance

To test the performance of these dual core processors, a single task was assigned to each core. In the case of the H7, the M7 core was given the task of calculating Pi, while the M4 core was assigned the task of finding prime numbers between 1 and 300,000. Similarly, in the S3 model, core 0 was responsible for calculating Pi, and core 1 for finding prime numbers.

Speed Difference with Single and Dual Tasks

The objective of the test was to observe the speed difference between performing a single task and two tasks assigned to different cores. Both tasks were executed independently. As anticipated, the Pi calculation by the M7 core of the H7 processor was completed first, taking approximately 6 seconds. Despite working on different cores, the H7 processor demonstrated exceptional performance.

Next, the Pi calculation assigned to core 0 of the S3 model was completed, taking approximately three seconds longer than when it was performed using a single core. This indicates a slight decrease in performance due to the division of tasks across multiple cores.

To analyze this further, we can look at the specific time taken by each core. The low power core of the H7 processor took around 113 seconds to complete its task, while the task assigned to the first core of the S3 model took approximately 161 seconds. This highlights a significant performance difference between the M7 and M4 cores of the H7 processor. As expected, the M4 core is relatively lacking in power and efficiency.

The Impact of Computational Performance on Different Calculations

Computational performance plays a crucial role in determining the efficiency and speed of various calculations and tasks. In this article, we will explore the differences in computational performance between the H7 and S3 devices, and how it can make a significant difference depending on the calculations being performed.

Comparing H7 and S3

In a recent video, we compared the computing power of the H7 and S3 devices. It became evident that the H7 outshines the S3 in terms of hardware specifications. However, the drawback lies in its expensive price tag. On the other hand, the S3 is more affordable, making it an attractive option for many.

The Extra Function of H7

Despite its high price, the H7 does come with an additional feature that sets it apart from the S3 – the ability to connect to an external display. This is especially useful for projects that require a larger screen to showcase visual elements or for presentations. The H7’s compatibility with HDMI displays makes it a versatile choice.

The Importance of Task Distribution

When it comes to performance, it is crucial to consider how tasks are distributed across the available cores. The S3 operates with two cores that maintain constant performance. However, when there are two tasks, the speed of the second task is reduced by half. This limitation can impact certain calculations that heavily rely on parallel processing.

Consideration for Project Requirements

Choosing between the H7 and S3 devices ultimately depends on the specific requirements of the project at hand. While the H7 may offer superior computational performance, it comes at a higher cost. On the other hand, the S3 provides a more budget-friendly option without compromising on overall functionality.

Based on the performance comparison conducted in this article, it is evident that H7 surpasses S3 in terms of computational speed and efficiency. Although both devices use the same code and have a similar clock speed, H7 consistently outperforms S3 in various tasks. These results emphasize the importance of considering computational performance when choosing a device for specific applications.

Dual core processors, like the H7 and S3 models, offer improved performance and speed by dividing tasks across multiple independent cores. While the H7 processor demonstrated remarkable performance and completed tasks swiftly, the S3 model experienced a slight decrease in performance when multiple cores were engaged. Nevertheless, dual core processors continue to revolutionize computing capabilities, providing faster and more efficient processing power for various applications.

The choice between the H7 and S3 devices when it comes to computational performance relies heavily on the nature of the calculations and the project’s budget. While both devices have their merits, it is essential to carefully evaluate the specific needs of the project to make an informed decision. There is no doubt that both the H7 and S3 are excellent devices, each with their unique advantages.

Thank you for reading and considering the various factors that impact computational performance in different scenarios.

Share.
Exit mobile version