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

the use of gzll and gzp for nRF51822

Hi, 1. I want to design a product as a tag,which can read the temperature and transmit the data to a host,the host can read several devices' data. which mode would I use? I have read the protocal of GZll ,and the exampie of the SDK is the transmittion of one host and one deveice,I don't kown how can one host and several devices. Can you give me an example,Thank you ! 2. I have learned the user guide of the Gzp protocal which can encrypt the transmitted data. But I can't understand how the Gzp works.and how it can realize the Frequency hopping Automaticlly? can you give me an Interpretation.thank you!

  • Hi Linda,

    1. The radio uses "pipes" to differentiate between different on-air RF addresses. You set the base address using function "nrf_gzll_set_base_address_1", and then you set the prefix byte using function "nrf_gzll_set_address_prefix_byte".

    The relation between "base address" and "prefix byte" is shown in the reference manual, chapter 16.1.4.

    To get a many-devices->one host, you set this base address and prefix bytes and open the RF pipe. On the host side:

    
    nrf_gzll_set_base_address_1(MY_DEVICE_BASE);
    for(int i=0; i < MAX_NUM; i++) 
      nrf_gzll_set_address_prefix_byte(i, my_prefixes[i]);
    // Enable all pipes
    nrf_gzll_set_rx_pipes_enabled(0xFF);
    

    Now, on the device side, you must set which device should communicate with which pipe.

    nrf_gzll_set_base_address_1(MY_DEVICE_BASE);
    nrf_gzll_set_address_prefix_byte(1, my_prefixes[1]);
    

    On device #2:

    nrf_gzll_set_base_address_1(MY_DEVICE_BASE);
    nrf_gzll_set_address_prefix_byte(1, my_prefixes[2]);
    

    And so on.

    1. Frequency hopping is a part of the Gazell protocol. GZP is a protocol built on top, which only adds pairing (and security for one pipe).

    Since there are so many devices that operate in the 2.4G band, you may end up in a situation where the nRF and your WiFi are competing against each other. Since wifi uses 20 MHz and ~20 dBm output power, it will win. To handle this better, Gazell will use frequency hopping. Frequency hopping is basically that you spread your communication through-out the 2.4 GHz band (2400 - 2483 MHz). In gazell you can set how many (and which) RF channels you want to communicate on.

    The device and host will share this channel tab, so that they eventually will "hit" each other. The host will go through it's channel tab, with a given interval (set in FW). Let's say that we have set channels 2, 40, 80, and a interval of 1 ms. The host will then start listening on channel 2, wait 1 ms, switch to channel 40, wait 1 ms, switch to 80, and then back again to channel 2. Increasing the number of RF channels will also increase the latency of your application. Channel table is set via this function: nrf_gzll_set_channel_table(gzll_channel_table, sizeof(gzll_channel_table));

    Synchronous device: The synchronous device mode is where the device will follow the host channel switching. It will start to transmit on one channel, and when it get's an ACK (acknowledge) from the host, it then can predict the host's pattern and try to keep in sync for a more effective communication. Typically, this mode is used for applications like mice, beacons, etc. Basically any application that sends data in a given interval.

    Setting up a synchronous device which transmits on same channel:

    Set channel policy to: NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT
    using function "nrf_gzll_set_device_channel_selection_policy"
    Setup "nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync" to equal channel-tab size * timeslots_pr_chan
    

    Setting up a synchronous device which follows the host channel tab:

    Set channel policy to: NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT
    Using function "nrf_gzll_set_device_channel_selection_policy"
    Setup "nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync" to equal channel-tab size * timeslots_pr_chan
    

    Asynchronous device: This is a more "simple" mode. The device may wake up, start sending a payload, and keep re-transmitting this until it hits max-retransmit-counter, or until it gets an ACK from the host. It will not try to predict the pattern of the host.

    This mode is normal for all applications that sends data "once in a while", with no interval pattern. Keyboards and remotes usually use this mode.

    Setting up a asynchronous device:

    
    Set channel policy to: NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL
    Using function "nrf_gzll_set_device_channel_selection_policy"
    Set "nrf_gzll_set_sync_lifetime" to 0
    
    

    Note: the host only has one mode. it just goes around-and-around listening for RF payloads.

    I am also attaching an example that shows multi-link communication using GZP (proximity pairing, must be placed within 20cm of the host to pair up!) Set up more devices by changing the macro "DEVICE_DEFAULT_PIPE" to another device.

    Best regards Håkon

    gzp_dynamic_pairing_more_devs.zip

  • Hi Hakon.. you have not used set_base_address_1 () functions in your posted example of dynamic pairing.

Related