This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC2650: CC2650 Sensortag: Lowering accelerometer interval to 10ms issue

Part Number: CC2650

Tool/software: Code Composer Studio

Hello,

i am having a connection between my CC2650 sensortag and Linux sending accelerometer data.

The standard minimum interval for sending/reading the sensors is 100ms. I tried to lower it to 10ms to achieve a frequency of 100 Hertz, which I really need for my thesis. 

I adapted the firmware as follows:

Sensortag.c

// How often to perform periodic event (in milliseconds)
#define ST_PERIODIC_EVT_PERIOD 10 //before 1000

// What is the advertising interval when device is discoverable
// (units of 625us, 160=100ms)
#define DEFAULT_ADVERTISING_INTERVAL 40 //before 160

// General discoverable mode advertises indefinitely
#define DEFAULT_DISCOVERABLE_MODE GAP_ADTYPE_FLAGS_LIMITED

// Minimum connection interval (units of 1.25ms, 80=100ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MIN_CONN_INTERVAL 8 //before 8

// Maximum connection interval (units of 1.25ms, 800=1000ms) if automatic
// parameter update request is enabled
#define DEFAULT_DESIRED_MAX_CONN_INTERVAL 8

// Slave latency to use if automatic parameter update request is enabled
#define DEFAULT_DESIRED_SLAVE_LATENCY 0

// Supervision timeout value (units of 10ms, 1000=10s) if automatic parameter
// update request is enabled
#define DEFAULT_DESIRED_CONN_TIMEOUT 100

// Whether to enable automatic parameter update request when a
// connection is formed
#define DEFAULT_ENABLE_UPDATE_REQUEST GAPROLE_LINK_PARAM_UPDATE_WAIT_BOTH_PARAMS

// Connection Pause Peripheral time value (in seconds)
#define DEFAULT_CONN_PAUSE_PERIPHERAL 1

st_util.h

// Data readout periods (range 100 - 2550 ms)
#define SENSOR_MIN_UPDATE_PERIOD 10 // Minimum 100 milliseconds
#define SENSOR_PERIOD_RESOLUTION 10 // Resolution 10 milliseconds

sensortag_mov.c

// How often to perform sensor reads (milliseconds)
#define SENSOR_DEFAULT_PERIOD 10

But still I receive the sensor data every 100ms after I request it. I am using bluepy/bluez and I thought this must be the limiting problem. Or did I forget to change something in the firmware?

Thank you very much!

  • Hello,

    Which version of the SDK are you using? Maybe your bluepy/bluez (Central) is requesting a connection parameter update or it could be rejecting the parameter update from the Peripheral. Do you have a sniffer log that you can share?

    A couple of things that you can try:
    1. Change DEFAULT_CONN_PAUSE_PERIPHERAL
    #define DEFAULT_CONN_PAUSE_PERIPHERAL 8
    Eight seconds after a connection is established, the GAP layer automatically sends a connection parameter update, see if this makes any difference

    2. Use a different central (ex. CC26xx Launchapad) to confirm that the connection parameter update is happening. If you do not have another central device, please upload your sensorTag image and I'll test it on my side.

    Best regards,

    David
  • Check if nActivity is equal to 0 in your SensorTagMov_processSensorEvent so it won't send data.
  • Thanks for your help!
    Finally changing
    #define DEFAULT_ENABLE_UPDATE_REQUEST GAPROLE_LINK_PARAM_UPDATE_WAIT_BOTH_PARAMS
    to TRUE solved my problem.