<?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>NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15182/nrf52-real-sampling-rate-different</link><description>Hello,
I was wondering why I am not getting a theoretical sampling rate as I set them to with a timer. 
 I am using PPI to trigger a SAADC sampling with the timer to set to 8ms.
However, I am not getting a sampling rate with 125Hz. My Connection intervals</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Aug 2016 03:37:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15182/nrf52-real-sampling-rate-different" /><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57963?ContentTypeID=1</link><pubDate>Fri, 26 Aug 2016 03:37:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db1c0cef-6827-4722-86ef-7f48e25ea5d5</guid><dc:creator>Jong yoon lee</dc:creator><description>&lt;p&gt;I Fixed the Problem!
Even with TImeSlot going on, I am getting a transfer rate of a value little over 1000 when i have the sampling rate of 1KHz.&lt;/p&gt;
&lt;p&gt;I just had a simple error in my code.(Off by one error)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57962?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2016 19:14:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc26fb71-9c0b-4ecf-9779-4b8bd475df76</guid><dc:creator>Jong yoon lee</dc:creator><description>&lt;p&gt;OK, that sounds good. I though using PPI would be the work around.
Can you link me to any good source that I can read regarding this topic
Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57961?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2016 11:35:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f577eb93-17b9-4e22-b650-a52327cbb66c</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes and no. You can expect that there will be some packet loss, but BLE is a reliable protocol. Every packet is acknowledged if it is received, so if it does not get received it will get retransmitted. This is handled automatically for you by the SoftDevice.&lt;/p&gt;
&lt;p&gt;What you are likely seeing is that the measurements that occur during BLE connections are failing. You can work around/with this, but I suggest doing some reading on time critical measurements and SoftDevice usage first and then creating a new question as we are moving beyond the scope of the initial topic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57960?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2016 10:45:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43b319ed-317f-43f4-8ce0-651592944c85</guid><dc:creator>Jong yoon lee</dc:creator><description>&lt;p&gt;Sorry for the late update!
I did some testing and as you said the ppi and ssadc timings were very accurate.
However, it turned out that I was losing data while they were being sent to the phone via BLE.
With the connection interval at 10ms and sending 16 bytes per packet, I was able to only receive 80% of the total packet I send. This was regardless of the sampling rate(I tried 125Hz 500Hz 1000Hz).
I did some research online and some say that BLE is not a reliable protocol and is expected to lose some packets on air. Is this true about BLE? I expect the packet loss rate to be much lower. If the data loss rate is true is there other ways I can reduce the packet loss?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57958?ContentTypeID=1</link><pubDate>Tue, 19 Jul 2016 07:45:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0b41272-e6cc-4cc5-bd7e-8a019811b86b</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Well, running a lot of things at the same time means there are more things that can potentially go wrong. However I think this should be fairly simple to get running. By the way, it may be worth looking into the &lt;a href="https://devzone.nordicsemi.com/tutorials/19/"&gt;Application timer tutorial&lt;/a&gt; if you will use the LFCLK.&lt;/p&gt;
&lt;p&gt;The SoftDevice uses the HFCLK at two times, when the radio is running and when it has to calibrate the LFRC (Low frequency RC clock source, if you do not have a separate LF crystal). The HFCLK adds a lot of current consumption when running, and should therefore be left off when not in use.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57959?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 19:12:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b7edb8c-66ab-4990-9021-76628b5d823d</guid><dc:creator>Jong yoon lee</dc:creator><description>&lt;p&gt;Hello,
Thank you for your thoughtful answer.
I will go ahead and do the GPIO test today.&lt;/p&gt;
&lt;p&gt;In My question, I forgot to indicate that I was using timeslot for multiprotocol with nrf_esb.
Can that be the reason it would not work?&lt;/p&gt;
&lt;p&gt;Also, I have one question regarding your answer.
With soft device working, I thought that HFCLK will always run because I do not have code anywhere that turns the HFCLK on. Is this not true and will the HFCLK only be turned on when a radio event is happening?&lt;/p&gt;
&lt;p&gt;Thank you,
John Lee&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52 real sampling rate different</title><link>https://devzone.nordicsemi.com/thread/57957?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 13:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19b44577-ddfe-4502-b82f-c0b492e567dc</guid><dc:creator>&amp;#216;yvind Karlsen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Since you are using 8ms sample intervals the HFCLK based TIMER is not recommended as it adds a lot of current consumption. Instead you can use the LFCLK.&lt;/p&gt;
&lt;p&gt;The sample rate is relatively slow, so you should not need to be worried about being interrupted by SoftDevice activity. To ensure that you do not collide with the SoftDevice you can read the buffers from a lower priority interrupt when the application has time.&lt;/p&gt;
&lt;p&gt;Instead of using the SAADC directly have you tried to set a GPIO using the task and measuring the frequency, if so, what did you get?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Øyvind&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>