<?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>S130 measuring radio on time accurately</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30454/s130-measuring-radio-on-time-accurately</link><description>Using S130 to request notifications of radio activity as: 
 
 fails with NRF_ERROR_INVALID_PARAM. 
 Is there a reason this combination is disallowed? The use case for it is tracking the amount of time spent in various operational modes, of which &amp;quot;radio</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Feb 2018 13:55:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30454/s130-measuring-radio-on-time-accurately" /><item><title>RE: S130 measuring radio on time accurately</title><link>https://devzone.nordicsemi.com/thread/120839?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 13:55:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfa4649e-2e0c-4b21-b991-1091e46b5fdc</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;I don&amp;#39;t read the documentation that way. There&amp;#39;s a recommendation (but not requirement) to use DISTANCE_NONE when using TYPE_NONE, but no clear statement that DISTANCE_NONE plus TYPE_INT_ON_ACTIVE is invalid.&lt;/p&gt;
&lt;p&gt;My question was really why sd_radio_notification_cfg_set() disallows the combination. If you want to turn off notifications, that&amp;#39;s covered by TYPE_NONE. DISTANCE_NONE is allowed for INT_ON_INACTIVE; disallowing it for INT_ON_ACTIVE lacks motivation.&lt;/p&gt;
&lt;p&gt;That what the notification brackets is a connection interval is helpful; thanks.&lt;/p&gt;
&lt;p&gt;As to what I&amp;#39;m doing: I&amp;#39;ve set up a framework to measure time spent in various modes, e.g. in below A=active, S=sleep; R is radio on:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  A--: 00:15:44.660   30954628
  S--: 41:34:05.245  608608115
  A-R: 00:00:04.361     142912
  S-R: 00:03:55.732    7724490&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I will be using external instrumentation to estimate the power consumed by various operations; from that and time-in-mode I&amp;#39;m hoping to get a more accurate estimate of remaining battery life that is available from estimating remaining Ah from measured battery voltage. If I extend that with a count of radio-on events, then I can do a correction of n*800, but I won&amp;#39;t be able to attribute the duration to the correct operational mode.&lt;/p&gt;
&lt;p&gt;Thanks for the pointers on PA/LNA for nRF52; I haven&amp;#39;t gotten to that series yet, but will probably try that technique when I do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S130 measuring radio on time accurately</title><link>https://devzone.nordicsemi.com/thread/120806?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 11:29:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:731cbe2d-da90-420f-aa92-93ee35fcb895</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The sd_radio_notification_cfg_set() disables the signal if you set the NRF_RADIO_NOTIFICATION_DISTANCE_NONE, as described in the API documentation:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Configures the Radio Notification signal.
 *
 * @note
 *      - The notification signal latency depends on the interrupt priority settings of SWI used
 *        for notification signal.
 *      - To ensure that the radio notification signal behaves in a consistent way, the radio
 *        notifications must be configured when there is no protocol stack or other SoftDevice
 *        activity in progress. It is recommended that the radio notification signal is
 *        configured directly after the SoftDevice has been enabled.
 *      - In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice
 *        will interrupt the application to do Radio Event preparation.
 *      - Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have
 *        to shorten the connection events to have time for the Radio Notification signals.
 *
 * @param[in]  type      Type of notification signal, see @ref NRF_RADIO_NOTIFICATION_TYPES.
 *                       @ref NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio
 *                       notification. Using @ref NRF_RADIO_NOTIFICATION_DISTANCE_NONE is
 *                       recommended (but not required) to be used with
 *                       @ref NRF_RADIO_NOTIFICATION_TYPE_NONE.
 *
 * @param[in]  distance  Distance between the notification signal and start of radio activity, see @ref NRF_RADIO_NOTIFICATION_DISTANCES.
 *                       This parameter is ignored when @ref NRF_RADIO_NOTIFICATION_TYPE_NONE or
 *                       @ref NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used.
 *
 * @retval ::NRF_ERROR_INVALID_PARAM The group number is invalid.
 * @retval ::NRF_ERROR_INVALID_STATE A protocol stack or other SoftDevice is running. Stop all
 *                                   running activities and retry.
 * @retval ::NRF_SUCCESS
 */
SVCALL(SD_RADIO_NOTIFICATION_CFG_SET, uint32_t, sd_radio_notification_cfg_set(uint8_t type, uint8_t distance));&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However, if you want to see when the actual RADIO is active, this will not give you any detailed information, as it provides a event before and/or after a connection interval, which also include stack processing.&lt;/p&gt;
&lt;p&gt;If you are interested in the detailed timing of the radio receive and transmit windows, it is not possible to get those numbers in firmware. At that point, you&amp;#39;ll need to analyze the dynamic current consumption using external equipment.&lt;/p&gt;
&lt;p&gt;If you want to know the length of your connection interval, your current solution with using radio_notification with a distance of 800 us, would be an alternative (measure time, then subtract 2*800us).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nRF51-devices has the pin &amp;quot;VDD_PA&amp;quot;, which is a pin that goes high 50 us before the radio goes into TX mode, and goes low immediately after a transmission ends. You can probe this, or even use a timer to get the length of it. But, on the nRF51-series, you do not have an option to check the RX length.&lt;/p&gt;
&lt;p&gt;This pin is commonly used to control external RF PAs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The nRF52-devices does not have the &amp;quot;VDD_PA&amp;quot; pin, so the PA/LNA functionality is then built in to the SoftDevice, using the sd_ble_opt_set/get API. When this is set, you can get PA and LNA signals outputted on GPIOs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What do you want to obtain? If you want to profile your current consumption, then I&amp;#39;d recommend looking at the power calculator for nRF52-devices:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/power/"&gt;https://devzone.nordicsemi.com/power/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For nRF51-series power profiling, we do not have a automated calculator, but there are scenarios listed in the S130 datasheet:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.sds/dita/softdevices/s130/ble_power_profiles/ble_power_profiles.html?cp=3_7_2_0_17"&gt;http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.sds/dita/softdevices/s130/ble_power_profiles/ble_power_profiles.html?cp=3_7_2_0_17&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>