An Overview of BLE Frequency Hopping Algorithms

BLE has a total of 40 2.4GHz signals, of which 3 are broadcast channels and 37 are data channels. To avoid interference during data communication, frequency hopping occurs among the 37 channels. The BLE protocol defines two frequency hopping algorithms, namely CSA (Channel Selection Algorithm).Here, we will briefly analyze the implementation methods of the two CSAs, starting with the definition of the channel map. The channel map is a field in the CONNECT_IND or AUX_CONNECT_REQ PDU.An Overview of BLE Frequency Hopping AlgorithmsIt indicates which of the 40 channels are used and which are not. Each bit represents a channel index; if the bit = 0, it indicates that the channel is not in use, and if the bit = 1, it indicates that the channel is in use.

  • CSA#1

This is the traditional frequency hopping method, which only supports connection events. The calculation steps are as follows:An Overview of BLE Frequency Hopping Algorithms

  • Use a fixed hop increment (an integer between 5 and 16) as the step size for each frequency hop that is not mapped.
  • Calculate the unmapped channel:

An Overview of BLE Frequency Hopping Algorithms

  • If the unmapped channel is marked as used in the channel map, then the current connection time will use that channel; otherwise, perform a remap operation to map the unmapped channel to a channel in the channel map.
  • The calculation of the remapping index is as follows:

An Overview of BLE Frequency Hopping AlgorithmsWhere numUsedChannels indicates the number of channels used in this connection.

  • Look up the required channel using the remapping index in the remapping table, which is the list of currently used channels.
  • CSA#2

This is a new frequency hopping algorithm introduced after BLE 5.0, which is designed to be more complex but more resistant to interference. It can support connection events, periodic advertising events, isochronous events, etc. The calculation steps are as follows (only the upper half of the event is described):An Overview of BLE Frequency Hopping Algorithms

  • Input a 16-bit channel identifier, which is fixed for a specific connection. The calculation method is as follows: it is the XOR of the high 16 bits and low 16 bits of the access address.An Overview of BLE Frequency Hopping Algorithms
  • Generate a pseudo-random number prn_e using a 16-bit event counter (which increments with each connection event) as follows:An Overview of BLE Frequency Hopping AlgorithmsWhere MAM, PERM, and other operations are described in detail in the protocol.
  • Calculate the unmapped channel as follows:unmappedChannel = prn_e mod 37
  • If the unmapped channel is marked as used in the channel map, then the current connection time will use that channel; otherwise, perform a remap operation to map the unmapped channel to a channel in the channel map.
  • The calculation of the remapping index is as follows:An Overview of BLE Frequency Hopping AlgorithmsWhere N is the number of channels used in the channel map.
  • Look up the required channel using the remapping index in the remapping table, which is the list of currently used channels.

Summary:The advantage of CSA#1 is its simple structure, easy hardware implementation, and relatively low resource overhead; its disadvantage is that the frequency hopping mode is fixed, the period is short, making it prone to overlap with interference, and after remapping, some channels may be used frequently, leading to uneven usage.The advantage of CSA#2 is its strong pseudo-randomness of the frequency hopping sequence, long period, and good resistance to interference, performing more stably in clean or heavily interfered environments; its disadvantage is that it is relatively more complex to implement, requiring counters, pseudo-random number generation, and more state machine support, with slightly higher hardware resource and power consumption overhead compared to CSA#1.Done!

Leave a Comment