This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52 floating point calculations' maximum overhead after connection

Hi, I use

  • PCA10040 V1.1.0 (nRF52832-QFAA)

  • Keil uVision 5.21

  • SDK 12.1.0 + S132 v3 (experimental_ble_app_hrs_pairing_nfc example)

  • Nexus 5 (Android 6.0, this device cannot install Nougat)

Since the nRF52 is based on a Cortex-M4F processor and it runs at 64MHz,

I'm about to insert codes which are related to floating point calculations after having a connection with a central device.

For instance, I use an MPU-6000 (6-Axis Gyro+Accel) via 1MHz clock SPI.

Although that chip has an internal processor that calculates quaternion or other stuff

(people called that processor as DMP),

suppose the nRF52 reads the raw data from the MPU-6000 and calculates quaternion instead of reading the quaternion from it which requires floating point multiplications.

So the code might look like this.

gap_params_init(); // in the main function

advertising_init();

services_init();

conn_params_init();

nfc_init(erase_bonds);

for (;;){
  if(bool_start_read_n_cal && bool_is_connected_with_central){
    custom_read_mpu();
    custom_calculate_quaternion(); // this uses floating point calculations
  } power_manage();
}

However, if the calculation overhead is huge,(in other words, the floating point calculation takes too long, let's call this time variable t_f),

as far as I know, the connection with the central will be disconnected.

/*********************************************************************/

So my question is,

Suppose I use the highest compiler optimization level in Keil.

What is the maximum value of t_f to stay connected with the central?

Does this varies when changing MIN_CONN_INTERVAL, MAX_CONN_INTERVAL, or else?

-Best Regards, Mango

Related