<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61994/ant-pre-event-timing</link><description>Hi, 
 I have a simple question. How should I handle situation, when need to collect data and process them before the computed data are sended via ANT+ profile which runs on 4Hz update rate? I had an idea to use repeated timer, but it is not possible,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 16 Jul 2020 10:07:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61994/ant-pre-event-timing" /><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/260330?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 10:07:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33f27d09-d0f3-4ef4-8472-e01d3e2c999b</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Typically in&amp;nbsp;ant_evt_handler() you will get an&amp;nbsp;EVENT_TX. Then you can start an single shot app_timer that for instance will timeout after 240ms (this might be a reasonable timeout if for instance the ANT interval is 250ms), then on the timeout handler you can run sensor sampling and write to new data to ANT using sd_ant_broadcast_message_tx().&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/260263?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2020 05:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5047c4b7-90b2-41bb-a8d4-fa85076e4a44</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/kenneth"&gt;Kenneth&lt;/a&gt;, thanks for reply and idea. But please could you explain me or point to some threads where could I learn in which way should I work with EVENT_TRANSFER_TX_COMPLETED event? How should I sense this event? Is it possible to interconnect it via PPI and fire timer task start after this event? Or does it have some interrupt handler? My goal is to let cpu sleep as much as possible due to power consumption so hope that it is not required cpu to wait and be listening for this event.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/260127?ContentTypeID=1</link><pubDate>Wed, 15 Jul 2020 12:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cddc780a-b342-4dd8-b577-9b5a82c11ff0</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The radio nofification signal may also be triggered by other activity such as timeslots due to flash operations or other radio&amp;nbsp;activity (e.g. searching, BLE if you support that) etc. Can this be the case here?&lt;/p&gt;
&lt;p&gt;Maybe it is better idea to sync on&amp;nbsp;an event from ANT, e.g. start an app_timer on &lt;span&gt;EVENT_TRANSFER_TX_COMPLETED&amp;nbsp;&lt;/span&gt;event that timeout before the next ANT interval?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/259985?ContentTypeID=1</link><pubDate>Tue, 14 Jul 2020 18:35:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dea72181-c822-4c52-ac68-1de4eb261892</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/kenneth"&gt;Kenneth&lt;/a&gt;, I have other problem with radio notification. I have added timer measuring to SWI1_IRQ handler to see if the timing is correct. Radio notifications are configured to fire handler on inactive radio event, 2480us after radio has been disabled, but when I print time that have passed from previous event, it is a bit weird. It shows 11ms and then 235ms. These numbers occur periodically. It looks like something using the SWI1 handler also? Please see attached print screen with code.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Pepam&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2742.radio_5F00_notification_5F00_issue.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/254360?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 05:43:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6236f0d0-0e6f-4ba9-9573-27298765d928</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;Hi Kenneth,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I solved it with a help from this&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/radio-notification"&gt;Tutorial&lt;/a&gt;. I have copied the code from tutorial and it worked. Don&amp;#39;t know why, because both codes do exactly the same thing, but now it&amp;#39;s working.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/253347?ContentTypeID=1</link><pubDate>Thu, 04 Jun 2020 15:11:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ef2634a-b22f-4b95-91c3-89bf0e987a46</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;NRF_LOG_INFO() is okay, I can see that handler doesnt run on inserted breakpoints anyway. I&amp;#39;ll let you know&amp;nbsp; about any progress.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/253129?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 19:16:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebfdcec2-dae4-470e-9ee3-43ed82f3e4dc</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I do not see how this should fail. It seems to be documented for both S212 and S332:&lt;br /&gt;&lt;a href="https://www.thisisant.com/resources/212-v20-sds"&gt;https://www.thisisant.com/resources/212-v20-sds&lt;/a&gt;&lt;br /&gt;&lt;a href="https://www.thisisant.com/resources/s332-v20-sds"&gt;https://www.thisisant.com/resources/s332-v20-sds&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Maybe&amp;nbsp;NRF_LOG_INFO() for some reason doesn&amp;#39;t work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/253121?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 18:46:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3a8c006-3624-48db-b96f-efef57a506e9</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;No, ble_radio_notification_init() runs without any problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/253120?ContentTypeID=1</link><pubDate>Wed, 03 Jun 2020 18:36:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b94eb18-1742-49ad-8252-6ad5a45effb3</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Is there any error code from&amp;nbsp;ble_radio_notification_init()? The &lt;span&gt;ble_radio_notification_init() is already&amp;nbsp;&lt;/span&gt;calling&amp;nbsp;sd_radio_notification_cfg_set().&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/252842?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 19:31:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:989b9573-6b58-4bf9-bf29-5e3e08cd46a3</guid><dc:creator>Pepam</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thanks for reply. I have implemented as it is shown on attached code. It compiles succesfull,&amp;nbsp; but handler is not called before/after events at all. Please any suggestion?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks,&lt;/p&gt;
&lt;p&gt;Pepam&lt;pre class="ui-code" data-mode="text"&gt;void ble_on_radio_active_evt(bool radio_active)
{
     NRF_LOG_INFO(&amp;quot;running&amp;quot;);
}

static void radio_notification_init(void)
{
    uint32_t err_code;

    err_code = ble_radio_notification_init(NRF_RADIO_PRIORITY_HIGH,
                                           NRF_RADIO_NOTIFICATION_DISTANCE_800US,
                                           ble_on_radio_active_evt);

    err_code = sd_radio_notification_cfg_set(NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE,
                                             NRF_RADIO_NOTIFICATION_DISTANCE_800US);
    APP_ERROR_CHECK(err_code);
}



/**@brief Function for application main entry, does not return.
 */
int main(void)
{

ret_code_t err_code;
    log_init();

    err_code = app_timer_init();
    twi_init();
    
    nrf_delay_ms(100);
    int rc = 0;
    rc = setup_hoge();
    nrf_delay_ms(100);
    
            //mpu_init();
    utils_setup();
    softdevice_setup();
    radio_notification_init();
    //ble_radio_notification_init(NRF_RADIO_PRIORITY_NORMAL, NRF_RADIO_NOTIFICATION_DISTANCE_5500US, handler(true));

        create_timers(); 
    //err_code = app_timer_start(data_send, APP_TIMER_TICKS(237), NULL);
    APP_ERROR_CHECK(err_code);
    simulator_setup();
    profile_setup();

    NRF_LOG_INFO(&amp;quot;ANT+ Bicycle Speed and Cadence TX example started.&amp;quot;);

    for (;;)
    {
        NRF_LOG_FLUSH();
        nrf_pwr_mgmt_run();
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANT+ pre-event timing</title><link>https://devzone.nordicsemi.com/thread/252698?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 11:30:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8decbcc0-f824-4540-a3cf-4aab1d68f6a6</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You should check out Radio Notification in the Softdevice Specifications. This is a callback that the softdevice can provide to the application a fixed time before an Radio event (for instance ANT data) occurs. In the nRF5 SDK I believe you should find ble_radio_notification.c that can do this for you already, it will will work for ANT also.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>