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

Sending hexidecimal sensor data over BLE

Hi, Hope your are well, i am currently in the final part of my project where i am SPI Gyroscope float data from one nordic nrf52dk (S132) to another such that i can analyize the data from my PC. My only problem is that at the moment i am receiving the data rather slow (around 10ms per string using snprintf). The sensor i am using has configurable Output data rate and atm it is configured at 1000Hz thus my actual data rate is nothing close to that. I am certain that a majority of the issue lies that i am converting the sensor register output into a float such that i get the values directly and hence i am trying to remove this and send the hexadecimal registers directly as an array of 6 bytes (1 byte per register) such that in the SPI handler it will send the data and during the ble_send it will be gathering another set of data from the sensor. I belive that this should be the only way how to effeciently speed up the process and have all the data manipulation after it has been sent and received by BLE. May i please get some help as to how to do this. any help would be greatly appreciated as i have spent over a week trying this out on my own. 

Thanks in advance best regards

Nikolai Dimech 

Parents
  • Hi,

    Are you using the SPIM or SPI peripheral? 

    hence i am trying to remove this and send the hexadecimal registers directly as an array of 6 bytes (1 byte per register) such that in the SPI handler it will send the data and during the ble_send it will be gathering another set of data from the sensor.

    Sending hex data can be done by using the NUS module, ble_nus_data_send() takes in a uint8_t array of length p_length. Which means that the functions takes in a byte array and sends it over BLE. See the ble_app_uart example if you need an example on how to use the NUS module.

    regards

    Jared 

Reply
  • Hi,

    Are you using the SPIM or SPI peripheral? 

    hence i am trying to remove this and send the hexadecimal registers directly as an array of 6 bytes (1 byte per register) such that in the SPI handler it will send the data and during the ble_send it will be gathering another set of data from the sensor.

    Sending hex data can be done by using the NUS module, ble_nus_data_send() takes in a uint8_t array of length p_length. Which means that the functions takes in a byte array and sends it over BLE. See the ble_app_uart example if you need an example on how to use the NUS module.

    regards

    Jared 

Children
Related