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.

How to setup slave Sleep Clock Accuracy?

Sleep clock accuracy (SCA) can have a massive impact on a slave with  large connection latency.

E.g. a slave device with 100ms connection interval, connection latency of 299 and worst case sleep clock accuracy of 500ppm has to turn its receiver on 15 msec earlier than if it had an accurate sleep clock.  This is almost 15 times longer than the connection time itself.  In such case it pays to use 20ppm 32.768kHz crystal!

My question is where in the BLE stack slave SCA set up?

I had a look at HIDEmuKbd sample but could not find anything.  There are relevant function defined in ll.h and hci.h but they seem to be never called from anywhere in the project code.  What are default values then?

On the same note where do you define master SCA that gets sent to a slave during connection request?  Sending worse than required accuracy will make slave use more power. In above example if master sends 500ppm data (masterSCA = 0) in ADV_CONNECT_REQ than the slave would have to turn the receiver on 30 msec earlier than the master actually gets on the air!  If both clocks have 20ppm accuracy instead and this is properly reflected in BLE code then receiver on time window can be reduced from 30 msec to 1.2 msec.  This is a massive energy save.

Where in the code is it?

Thanks

Leo

  • The command is actually documented in the release notes (which can be found in the SW developer's guide):

    HCI Vendor Specific function HCI_EXT_SetSCACmd allows you to specify the exact sleep clock accuracy as any value from 0 to 500 PPM, in order to support any crystal accuracy with optimal power consumption. This feature is only available for slave / peripheral applications.

    You can find the prototype for the function in hci.h.

    As for the master's clock accuracy, when using CC254x as a master this value is fixed to +/- 50ppm.

  • If one does not make any explicit call to set the slave SCA parameter, what is the default value assumed by the TI stack?

    I could imagine that the stack would choose the worst-case value (500ppm) as the default, but if that's the case and one is using a better crystal, one should DEFINITELY make the call to tell the stack that you've got better accuracy and thereby save the resulting power.

  • From the TI BLE Vendor Specific HCI Reference Guide.....

    Description
    This command is used to set this device’s Sleep Clock Accuracy (SCA) value, in parts per million (PPM), from 0 to 500. For a Master device, the value is converted to one of eight ordinal values representing a SCA range (per [1], Volume 6, Part B, Section 2.3.3.1, Table 2.2), which will be used when a connection is created. For a Slave device, the value is directly used. The system default value for a Master and Slave device is 50ppm and 40ppm, respectively.