<?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>NRF51822 Timer Stops Automatically with Softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9453/nrf51822-timer-stops-automatically-with-softdevice</link><description>Dear All, 
 We are working on a custom board with NRF51822.Everything works fine apart from the timer. What we are doing is that once the board is booted, it reads some values from an external ADC (240hz sampling rate) and write those values to an external</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Sep 2015 09:49:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9453/nrf51822-timer-stops-automatically-with-softdevice" /><item><title>RE: NRF51822 Timer Stops Automatically with Softdevice</title><link>https://devzone.nordicsemi.com/thread/34897?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 09:49:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d611300-4fe5-4d84-8cc5-0d70c607e686</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Ok, thanks for your feedback.  I am glad it works for you now!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Timer Stops Automatically with Softdevice</title><link>https://devzone.nordicsemi.com/thread/34896?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 17:58:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:870a7bf1-92a6-41c6-b8cb-41744a9c79ee</guid><dc:creator>Li</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks Stefan. We figured out the problem was not related to the timer but some memory leaks in our problem. It keeps consuming the memory and this answers why it stops around the same time.
After we fixed it, everything works just fine now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF51822 Timer Stops Automatically with Softdevice</title><link>https://devzone.nordicsemi.com/thread/34895?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2015 15:53:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:357a5b8d-0096-4191-99d7-09b2fd970c34</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Li&lt;/p&gt;
&lt;p&gt;Make sure you do not use TIMER0 and RTC0 when the softdevice is enabled, as the softdevice uses those peripherals. But I doubt that is the case since the communication is fine for 15 minutes.&lt;/p&gt;
&lt;p&gt;What sd_app_evt_wait does is mainly to disable the CPU. This is normally done so that power can be saved between BLE radio events when the CPU is not needed. Read more about that in the &lt;a href="https://devzone.nordicsemi.com/question/5186/how-to-minimize-current-consumption-for-ble-application-on-nrf51822/#reply-5187"&gt;current consumption guide&lt;/a&gt;. All other peripherals can be enabled. So if you are communicating with e.g. the SPI master to the external modules, then SPI master should be fully operational in System On low power mode after you have called the sd_app_evt_wait. When a byte is received on the SPI, there will be an interrupt indicating that SPI data is ready and the CPU must wake up in order to process the data.&lt;/p&gt;
&lt;p&gt;How are you communicating with the external flash? Can you describe a little better your method of communication with the external ADC and flash? What is the priority of the interrupts that the external ADC and flash trigger?&lt;/p&gt;
&lt;p&gt;3ms is a short time. BLE connection event transferring one packet takes ~1ms, transferring 6 packets takes ~6ms, so I perhaps suspect that this sampling frequency is perhaps too high. Do you see the same behavior if you decrease the sampling frequency to e.g. every 10ms?  How long does it take to sample?&lt;/p&gt;
&lt;p&gt;Since you sample 240 times per second and only transfer data to flash every 30 seconds, I suspect you need to store a lot of sampling data at once. Does that work when you have to send data over BLE at the same time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>