Nano 33 BLE Rev2 processing speed as compared to Nano 33 IoT

I recently purchased a Nano 33 BLE Rev2 to replace a Nano 33 IoT for a BLE IMU project. I found that Nano 33 BLE Rev2 peripheral BLE notification for the standard twenty byte packet to the central android app to be more 50% slower than the Nano 33 IoT. I do understand the BLE Rev2 uses the nRF52840 and the IoT uses the SAMD21 Cortex®-M0+ 32bit low power ARM MCU. I would have expected the nRF52840 to have better performance as it implemented the ARM® Cortex-M4 processor and is clocked faster the SAMD21 Cortex®-M0+ 32bit low power ARM MCU.
I ran the following loop test:

unsigned long timerCounter = 0;
unsigned long lastTimerTime = millis();
float cyclesPerSecond = 1;

void setup() {
  // put your setup code here, to run once:
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
    timerCounter++;
    if (millis() - lastTimerTime > 5000) {
      cyclesPerSecond = timerCounter / 5.0;
      Serial.println("Cycles per Second: " + String(cyclesPerSecond) );
      timerCounter = 0;
      lastTimerTime = millis();
    }
}


The above code gives 82K Loop cycles/sec on the Nano 33 BLE Rev2 and 766K Loop cycles/sec on the Nano 33 IoT.
Is it expected that the Nano 33 BLE Rev2 is slower for the above loop code?  Maybe there is some configuration I didn’t do correctly.  Thanks in advance for responses.

I saw mention in another post "Nano 33 BLE is running mbed OS". So I rewrote the test script to use mbed Timer instead of the Arduino millis():

#include "mbed.h"

int timerCounter = 0;
float cyclesPerSecond = 1;

mbed::Timer t;

void setup() {
  // put your setup code here, to run once:
  //Initialize serial and wait for port to open:
  Serial.begin(115200);
  t.start();
}

void loop() {
  // put your main code here, to run repeatedly:
    timerCounter++;
    if (t.read_ms() > 5000) {
      cyclesPerSecond = timerCounter / 5.0;
      Serial.println("Cycles per Second: " + String(cyclesPerSecond) );
      timerCounter = 0;
      t.reset();
    }
}

This improved the Nano BLE rev2 cycles per second from 82K to 83.7K...an improvement, but the Nano IoT is still 766K cycles per second.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.