Embedded programming: Week 9

Group: Antero, Max

Group assignment:

  • Compare the performance and development workflows for other architectures

  • Document your work to the group work page and reflect on your individual page what you learned

  • Link to the current version of the group documentation for this week.

Introduction

We tested three different platforms by running a simple program on them.

Introduction to the platforms

The three boards whose development workflows were tested are STM32 Nucleo-64, Arduino UNO R3 and ESP32-DevKitC V4.

STM32 Nucleo-64

STM32 Nucleo-64 we have here uses ST Microelectronics STM32l152RE microcontroller. STM32 is a 32-bit microcontroller family based on the Arm Cortex-M processor. This STM32 Nucleo-64 board has apparently 32 MHz clock. The board has Arduino UNO V3 compatible expansion connector. See the manual for more details. The board has 512kB Flash memory.

Arduino UNO R3

Arduino UNO uses Microchip ATmega328P 8-bit microcontroller. It is the first USB-based Arduino board.The microcontroller is clocked by a 16 MHz ceramic resonator. The board has six PWM (Pulse Width Modulation) outputs in pins: 6 (Pin # 3, 5, 6, 9, 10 and 11). It has 14 digital I/O Pins (of which 6 provide PWM output) and 6 analog input pins. It has 32 kB Flash memory (0.5 kN used by the bootloader), 2 kB SRAM and 1 kB EEPROM.

ESP32-DevKitC

ESP32-DevKitC is a ESP-WROOM-32 module based developent board. ESP-WROOM-32 has embedded, Xtensa dual-core 32-bit LX6 microprocessor, up to 240 MHz, 448 KB ROM, 520 KB SRAM and 16 KB SRAM in RTC.

.

Performance measurements

We used Tektronix TBS 1202B-EDU oscilloscope to observe the output frequency performance of each of the boards. A simple program was constructed to each of the platforms to output square signal as fast as the board can output.

Setups

All the boards supported Arduino IDE. The output pins used had to be set properly and the correct platform selected in the IDE.

STM32 Nucleo-64

STM32 supports Arduino IDE, so the programming was done there using the familiar workflow. The code is shown below

.

The setup describing how the oscilloscope was connected is shown below.

.

The measurements of output signal is shown below. The output frequency was 173.0 kHz. .

Arduino UNO R3

The code used in testing Arduino Uno board is shown below. It was ran following the same steps as other tasks performed in Arduino IDE environment.

.

The performance of Arduino is shown in figure below. Output frequency of Arduino was 60.6359 kHz.

.

ESP32-DevKitC

The programming for ESP32 was done in Arduino IDE. The settings had to be adjusted accordingly. For example, the card had to be selected on the IDE. .

The code used to measure the maximum square wave output performance of the board is shown in the image below

.

The setup describing how the oscilloscope was connected is shown below. . The performance of ESP32-DevKitC is shown in the image below. The measured output frequency was 1.23 MHz.

.

Conclusions

ESP32 was a clear winner with 1.23 MHz output frequency. STM32 was the second with 173 kHz frequency. 8-bit Arduino Uno was last, with 60.6 kHz output frequency.

A comparison between Arduino Uno and Nucleo F401 was used as reference here.

Feature of STM32 Nucleo 64 L152RE Arduino UNO V3 ESP32-DevKitC WROOM 32D
CPU Arm Cortex-M3 32-bit ATmega 328P 16-bit Xtensa 32-bit LX6
Clock Frequency 32 MHz 16 MHz 240 MHz
Flash 512 kB 32 kB 4 MB external
SRAM 80 kB 2 kB 520 kB
EEPROM 16 kB 1 kB
I/O LCD driver 14 digital I/O 34 x GPIOs (-6)
12 bit ADC 1 Msps (of which 6 can PWM) 12 bit SAR ADC up
12 bit DAC 2 channels 6 ADC 2 x 8-bit DAC
1 x USB 2.0 10 touch sensors
5 x USART 3 x UART
8 x SPI 4 x SPI
2 x I2C 2 x I2C, 2 x I2S
11 timers Two timer groups,
2 × 64-bit timers
in each group
Result 173 kHz 60.6 kHz 1.23 MHz