AnsweredAssumed Answered

NXP MCU is 10% slower than comparable Atmel MCU

Question asked by Ge GAO on Oct 31, 2018
Latest reply on Nov 5, 2018 by Ge GAO

Dear Support team,

  We have two platforms. One is based on Atmel D51, which has a MCU frequency 120Mhz. The other is based on NXP S32K148, which has a maximum MCU frequency of 112Mhz. I am using S32K148EVB.  However, while running the same software, we always find that the time it takes is 17% slower in NXP than in Atmel. Given the MCU speed is only 7% slower. There could be something wrong.

  The NXP is cache enabled by setting:

---------------------------------------------------------

LMEM->PCCCR = 0x85000001;
MSCM->OCMDR[0] = 0x20;
MSCM->OCMDR[1] = 0x20;

--------------------------------------------------------

  Atmel D51 is also cache enabled. 

  I wrote a test code like below:

--------------------------------------------------------

ts1 = Tm_GetTick();
output_image = malloc(9000);
for (int k = 0; k < 9000; k++) {
int tmp;
output_image[k] = k%200;
tmp = output_image[k];
tmp = (tmp * 3 - 150)%200;
output_image[k] = tmp;
}
for (int k = 0; k < 8500; k++) {
int tmp;
tmp = 0;
for (int i = 0; i < 400;i++) {
tmp += output_image[k + i] * i;
if (tmp > 1000) {
tmp = tmp %100;
}else {
tmp = tmp %200;
}
output_image[k] = tmp;
}
}

free(output_image);
ts2 = Tm_GetTick();
printf("take time=%d\n\r", (ts2- ts1));

------------------------------------------------------

NXP S32K148 takes 1889ms to finish while Atmel D51 takes 1607 ms to finish. A 17% differences. Is there anything I should do to improve the performance of NXP?

  Thanks.

 

Best

 

Ge

Outcomes