Embedded Programming - Group Assignment


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 group assignment page.

Inspiration: Jefferson Sandoval - Fab Academy 2021 week 9
To compare the performance for different architectures we chose 3 different microcontrollers and made them all perform the same calculations to see how they perform.
The microcontrollers we chose: ATtiny1614, Arduino UNO (ATMEGA328P), and the SAMD21E17A.
A theoretical comparison:

Microcontroller Estimated MFlops Flash. Program Memory Size
ATTiny1614 0,1 16 KB
ATMega 328P 0,08 32 KB
SAMD21E17A 0,21 128 KB
This is the code used for all of the tests:
/*
* pi.ino
* Neil Gershenfeld 12/20/20
* pi calculation benchmark
* pi = 3.14159265358979323846
*/

#define NPTS 100000

float a,b,c,pi,dt,mflops;
unsigned long i,tstart,tend;

void setup() {
   Serial.begin(115200);
   }

void loop() {
   tstart = millis();
   a = 0.5;
   b = 0.75;
   c = 0.25;
   pi = 0;
   for (i = 1; i <= NPTS; ++i)
      pi += a/((i-b)*(i-c));
   tend = millis();
   dt = (tend-tstart)/1000.0;
   mflops = NPTS*5.0/(dt*1e6);
   Serial.print("NPTS = ");
   Serial.print(NPTS);
   Serial.print(" pi = ");
   Serial.println(pi);
   Serial.print("time = ");
   Serial.print(dt);
   Serial.print(" estimated MFlops = ");
   Serial.println(mflops);
}
ATTiny 1614:

ATMega328P:

ATSAMD21E17A:

When comparing the ATTiny1614 with the ATMega328P, which is the previous generation, the ATtiny1614 has an improvement in performance.

Comapring the two with the SAMD21E17A we can observe that it nearly triples the performance of the ATMega328p and also more than doubles the Attiny1614s performance.This is made clear by the core the ATSAMD21E17A uses, which is the Cortex M0+ processor. According its technical reference manual, the Cortex M0+ offers "32 Bit performance". This is a substantial difference to the ATMega328p which is based on an 8-bit architecture, as well as the ATTiny1614, which also offers an 8-bit cpu.