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

Connection event trigger and Timeslot API

Good day to all

I would like to get a little more information about the function:


added in softdevice version 7.0.1.

Starting the radio in connection mode is shown in the figure (taken from the online power calculator). At what point will this trigger be issued?

Using the timer that starts on this trigger, I want to use timeslots before the connection event. At the moment, I have received the following diagram:

general

For run trigger:

IRQ Handlers:

Requsting timeslots:

I expected the session to be closed long before the start of the next connection event, but judging by the analyzer diagram, this happens later.

I have an assumption that this is due to handler priorities. The handler starts working later, after SD. Is this behavior correct?

I didn’t fully figure out how to correctly track the time of the time slot. Now I am measuring the time between events: NRF_RADIO_CALLBACK_SIGNAL_TYPE_START and NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0. 

Best regards,

Max

Parents
  • Hello,

    during the wait, I made some progress in this matter, so the questions and additions below are considered more relevant.

    I didn’t notice that I uploaded the same image twice. According to this diagram:

    Q1. Does a trigger for a connection event occur at the time of the "radio start"?
    Q2. If I try to get timeslots up to this point, will I get a busy error because the stack is already busy with the radio?

    The description of the NRF_RADIO_HFCLK_CFG_XTAL_GUARANTEED has note:

    Q3. does this mean that I do not need to make a request: sd_clock_hfclk_request(); before starting sd_radio_session_open() ?

    Q4. About function: sd_ble_gap_conn_evt_trigger_start(conn_handle, params). Since I plan to use this event on the client side, I have to use it for every new connection. As a parameter, this function transfers the PPI channel number and the connection handle.

    Q4.1. It turns out that if there will be many connections, for example 10, then I need 10 PPI channels?

    Q4.2. Or is it possible to use only one channel for all any number of connections?

    Q5. I realized that in vain I was requesting an extension of the time slot and because of this the session time was stretching. After correction, the diagram began to look like this:

    Time between radio-session opened and timeslot started is 1.782553 ms. I correctly understood that this time includes the launch and stabilization of HFCLK(~ 1.5ms according to the first figure) and it will not work to reduce it?

    Q6. Running a time slot now looks like this:

    ble_gap_conn_evt_trigger launches RTC timer to measure the interval. The interval is defined as follows:

    RTC->CC = CONN_INTERVAL - TIMESLOT_LENGTH - 2*1500,

    where: CONN_INTERVAL - setted connection interval in microseconds. [e.g. 30000];

    TIMESLOT_LENGTH  - length of timeslot, [e.g 1000];

    1500 - total preparation time for launch (Preprossesing, Crystal Ramp-up, standby, ...).

    By this time I came empirically. This method works, but does not look reliable. Maybe I'm trying to invent a wheel? Is it possible to obtain time data more accurately without using magic numbers?

    Best regards,

    Max

  •  Hi,

    Sorry for the late reply.

    I see that you have a couple questions that you want answered regarding time slots, and I'll try to answer the them :). But first I would like you to elaborate a bit more on this:

    Using the timer that starts on this trigger, I want to use timeslots before the connection event. At the moment, I have received the following diagram:

    From our developers:

    The event trigger task is triggered when the radio starts ramping up before the first reception or transmission in a connection event. That is, 40 us before the first radio activity. It is not possible to fit a timeslot in this period of time.
    What exactly is your goal of using radio timeslots? Did you want to use the Radio in the timeslot? If not, then maybe Radio notifications is the right approach. 
    The answer to Q3, and Q4 is yes :) 
    regards
    Jared
  • Hi,

    Sorry for the late reply.

    Do not worry about it, during this time I only plunged deeper into this topic)

    What exactly is your goal of using radio timeslots?

    We want use it for time synchronization (based on it). It is also necessary to ensure maximum energy efficiency of the device.

    Therefore, we decided to use the following scheme:

    time slots are activated before the event "connection interval".

    After a short exchange of tags, the radio switches to normal mode for data exchange already on the BLE channels.

    I have not yet come up with a better way to activate slots before this event occurs, as a countdown from the last interval.

    If not, then maybe Radio notifications is the right approach.

    I already read about it before, but why at the moment I could not remember. Thanks, I think it will take me a couple of days to comprehend the new information.

  • two days later ....


    Hello,

    I’ve got a little insight into the idea of radionifications, but so far I can’t say whether this tool suits me or not.

    I changed my code a bit to start the radio exchange through the time-slot api through the radio notification. Notifications were configured as follows:

    but I did not see anyone on the radio. For debugging, I assigned several pins to indicate certain events and made a recording with a logic analyzer.

    annotation:

    So, I see event from radio-notification 5500 us before the radio is activated (as planned).

    Next, I call the following functions:

    And timeslot is not activated, because in the event handler i get: NRF_EVT_RADIO_CANCELED.

    If i try reopened timeslot on it event, I see timeslot activity, but after connection event:

    So far, I'm at a loss. Is it possible to open a timeslot for transmitting proprietary data (ESB protocol) when using radio-notifications?

    how can I filter events? after all, everything falls under activity, including the “my” use of the radio.

    So far, my initial approach has more pluses, using only functions: sd_ble_gap_conn_evt_trigger_start();.

    Best regards.

    Max

  • additional information:

    I conducted a test and returned to starting time slots using the method described earlier (using a timer to start before the connection interval) without using NRF_RADIO_NOTIFICATION and got the following results

    As you can see in the figure marked 1, time slots open successfully (red track, p1.02).
    But if I just call a function

    whose handler does nothing but control the pin, then timeslots cease to be available.

Reply
  • additional information:

    I conducted a test and returned to starting time slots using the method described earlier (using a timer to start before the connection interval) without using NRF_RADIO_NOTIFICATION and got the following results

    As you can see in the figure marked 1, time slots open successfully (red track, p1.02).
    But if I just call a function

    whose handler does nothing but control the pin, then timeslots cease to be available.

Children
No Data