<?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>Problem with connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/1764/problem-with-connection</link><description>Hi,
I created firmware to nRF51822 Development Kit but I have a problem with connection. PCA10004 board is programmed to advertising packets whole the time and measure battery voltage level every hour (APP_TIMER_PRESCALER 8, BATTERY_LEVEL_MEAS_INTERVAL</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Mar 2014 13:19:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/1764/problem-with-connection" /><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7718?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2014 13:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61531789-2947-4b80-9cf9-1fa55728400c</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hi Torsten,&lt;/p&gt;
&lt;p&gt;Sorry that I reply so late but I had a lot of work. I changed timer prescaler to 4 and decrease timeout value to 20 minutes and everything works fine now. I will also check in free time file which you attachted.&lt;/p&gt;
&lt;p&gt;Thanks for help.&lt;/p&gt;
&lt;p&gt;Cheers
Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7717?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2014 13:18:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b39d289a-3001-48ae-803e-4bcbe551b8ff</guid><dc:creator>Torsten Rasmussen</dc:creator><description>&lt;p&gt;Further information on the RTC Counter, resolution, pre-scaler, and overflow can be found in the nRF51 Series Reference Manual v2.1, section 18.1.2, page 101-102.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7716?ContentTypeID=1</link><pubDate>Thu, 06 Mar 2014 13:12:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4140542-7509-41de-82f5-70cfe0f06e2a</guid><dc:creator>Torsten Rasmussen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;For the timer issue, you might want to try an change the pre-scaler value.&lt;/p&gt;
&lt;p&gt;The timer resolution with a pre-scaler value of 8 is:
(pre-scaler + 1) / 32768 kHz * 1000^2 = x us.
(8 + 1) / 32768 kHz * 1000^2 = 274 us.&lt;/p&gt;
&lt;p&gt;The Max RTC overflows at 0x00FFFFFF (0d16777215), thus maximum expiration time that is supported is:
274 us * 16777215 = 4608 seconds&lt;/p&gt;
&lt;p&gt;1 hour = 3600 seconds.&lt;/p&gt;
&lt;p&gt;We have seen an issue where timer has misbehaved when timeout value is &amp;gt; half the Max RTC, in this
case &amp;gt; 2304 seconds.&lt;/p&gt;
&lt;p&gt;Try to change the pre-scaler to 14, which will give a timer resolution of:
(14 + 1) / 32768 kHz * 1000^2 = 458 us.&lt;/p&gt;
&lt;p&gt;And max timer at:
458 us * 16777215 = 7680 seconds.&lt;/p&gt;
&lt;p&gt;The next SDK release will contain a fix for the app_timer related to start and stopping of the timer and this might fix your issue.&lt;/p&gt;
&lt;p&gt;To identify and reproduce your exact problem we would need more detailed information on how you set up the timers, when they are running and how often they are started and stopped.&lt;/p&gt;
&lt;p&gt;I have also attached an updated app_timer.c file that can be used and which might fix your issue when using timeout value &amp;gt; half max RTC.&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Torsten&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/app_5F00_timer.c"&gt;app_timer.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7715?ContentTypeID=1</link><pubDate>Tue, 04 Mar 2014 15:42:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1985d38-98bc-4a55-ae8b-60f2bc30e9fb</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;As Balaji points out, it seems as if your application immediately disconnects on connection, so there seem to be some problem with the way your applicaiton handles this timer. If you can find the problem, can you please supply the complete code project you&amp;#39;re working with, either by uploading it here or creating a regular support case?&lt;/p&gt;
&lt;p&gt;However, I&amp;#39;d also like to point out that given connection interval equal to the advertising interval, it&amp;#39;s much cheaper power-wise to stay in a connection than advertising. The reason is that staying in a connection will keep all communication on one channel, while advertising will send and receive on all three advertising channels. You therefore may want to reconsider this timer, if not strictly needed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7713?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2014 11:54:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9710dbcf-c40d-48b3-8b39-15312239472e</guid><dc:creator>Balaji Srinivasan</dc:creator><description>&lt;p&gt;If your objective is to have a longer battery life, then I suggest you use a longer connection interval in your application (instead of using timer to disconnect). Or you can also have a look at some good tips here on how to write low-power applications -&amp;gt; &lt;a target="_blank" href="http://devzone.nordicsemi.com/index.php/how-to-minimize-current-consumption-for-ble-application-on-nrf51822#reply-5187" rel="nofollow"&gt;http://devzone.nordicsemi.com/index.php/how-to-minimize-current-consumption-for-ble-application-on-nrf51822#reply-5187&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;There is one section titled &amp;#39;Tuning connection parameters&amp;#39; in the above link which might come in handy for you.&lt;/p&gt;
&lt;p&gt;About the randomness you see with your timer: I am sorry but I am not sure what is wrong. Is it possible to share the code piece (either here or by Private Message) which creates/starts/and stops the timers?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7712?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2014 11:17:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfc8bc0a-b76b-4a8b-96a4-a25795da6e3a</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;I have just discovered that issue may be caused by my second timer. I use it to disconnect with order &amp;quot;sd_ble_gap_disconnect(m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION)&amp;quot; after 2 minutes to protect by staying to long in connection mode and in that way extend battery life. It starts when device receives from stack &amp;quot;BLE_GAP_EVT_CONNECTED&amp;quot; event and I think that the problem is that this timer sometimes doesn&amp;#39;t count this 2 minutes but reports interruption at once and make disconnection. The toughest part to understand this problem is that it occurs randomly. Do you have any suggestions?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7714?ContentTypeID=1</link><pubDate>Mon, 03 Mar 2014 10:33:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18faeae2-1403-4338-8fb6-c8545b073513</guid><dc:creator>Balaji Srinivasan</dc:creator><description>&lt;p&gt;Hi Martin,&lt;/p&gt;
&lt;p&gt;To me, it is a bit hard to understand the issue with this information. But I observe that your firmware (the nRF51822 application) is disconnecting as soon as it got connected.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[14:58:20.4]&lt;/strong&gt; Connected to D2C54EA47F0C
&lt;strong&gt;[14:58:20.4]&lt;/strong&gt; Lost connection to device. Reason: BTLE_REMOTE_USER_TERMINATED_CONNECTION&lt;/p&gt;
&lt;p&gt;From the reason BTLE_REMOTE_USER_TERMINATED_CONNECTION, it is clear that its your firmware that is requesting the S110 SoftDevice to disconnect for some reason. May I suggest you search your source code for the error code &amp;#39;BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION&amp;#39; and see where it is being used?&lt;/p&gt;
&lt;p&gt;Cheers,
Balaji&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with connection</title><link>https://devzone.nordicsemi.com/thread/7711?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2014 16:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92ebc361-e08a-4818-b944-38c3f8aff6ef</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;I have just checked that my problem occurs very often but not always and sometimes I can&amp;#39;t connect with board in one moment but for example 10 minutes later I can.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>