<?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>[nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/20897/nrf52832-how-to-start-stop-saadc-the-right-way</link><description>Hi, 
 I have designed a system that uses the SAADC to sample 3 analog inputs in scan mode at 8 KSPS, performs downsampling by a factor of 8 using the DSP, and sends the results over BLE. 
 The sampling is done using PPI (EasyDMA) in a double-buffering</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Jul 2018 09:31:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/20897/nrf52832-how-to-start-stop-saadc-the-right-way" /><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/141293?ContentTypeID=1</link><pubDate>Wed, 25 Jul 2018 09:31:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caf8062c-ef59-4b2a-bea1-722f66794b31</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Please have a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/20291/offset-in-saadc-samples-with-easy-dma-and-ble/79053#79053"&gt;this answer&lt;/a&gt;. You will be facing the same issue when the CPU is blocked from handling the event when you halt it using the debugger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/141208?ContentTypeID=1</link><pubDate>Tue, 24 Jul 2018 19:31:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4329b740-de06-4804-9cad-ec217b90304f</guid><dc:creator>Bud Ward</dc:creator><description>&lt;p&gt;I am having a similar problem when debugging with JLink. I am reading 8 channels 16 times each and averaging the results for each channel. This works fine as long as I do not stop and start execution. When restarted all analog channels are shifted one position. Repeatedly starting and stopping does not cause a further shift; they stay in their one-off condition until reset. I have tried explicitly waiting for busy to clear and doing an abort before initiating the next buffer_convert - no effect.&lt;/p&gt;
&lt;p&gt;Using SDK_15.0.0.&lt;/p&gt;
&lt;p&gt;This thread is quite old. Has a solution been found?&lt;/p&gt;
&lt;p&gt;Thanks, Bud&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81609?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2017 14:24:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b63982a-0c1a-4fe8-a532-b8fee5f2fd67</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you having problems with double buffering? Could you post code showing how you setup, disable and enable the SAADC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81608?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 20:18:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15e10b1f-ccb3-4dd1-bdd5-6f3218cc6cbe</guid><dc:creator>Hamid</dc:creator><description>&lt;p&gt;Hi Jørgen,
I have the exact same problem on Starting/Stopping SAADC. Would you please post the possible solution?
Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81607?ContentTypeID=1</link><pubDate>Sun, 02 Apr 2017 08:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4f1cee2-b05e-4ab2-a571-6744c7383288</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;I am using SDK 12.1.0.  I will upload the project to MyPage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81601?ContentTypeID=1</link><pubDate>Fri, 31 Mar 2017 12:54:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:138fe07d-01f7-494c-a287-2150594249d5</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Which SDK version are you using? Are you able to share your project so I can do some testing on this? If you don&amp;#39;t want to share it in public you can create a case and upload it on &lt;a href="https://www.nordicsemi.com/eng/nordic/mypage"&gt;MyPage&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81603?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 12:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7975a1ed-c874-414b-8acd-7b1e8c07f022</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;Yes, I only get callbacks to the last buffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81602?ContentTypeID=1</link><pubDate>Thu, 30 Mar 2017 12:51:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b30acc7-88d6-428e-b411-dc490c6db5bc</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Your method of starting the SAADC again sounds correct. Are you checking return codes of the calls to &lt;code&gt;nrf_drv_saadc_buffer_convert()&lt;/code&gt; to see if it accepts the second call? Are you only getting callbacks when one of the buffers is filled?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81606?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 13:46:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8e32c54-8547-4ab6-a757-9a92a313387a</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;Also, I did use &lt;code&gt;nrf_drv_saadc_uninit()&lt;/code&gt; at first - exactly like you said - stopping first the timer, disabling the PPI and checking using &lt;code&gt;nrf_drv_saadc_is_busy()&lt;/code&gt; before calling &lt;code&gt;nrf_drv_saadc_uninit()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;However, when trying to restart it, I repeated the whole ADC initialization process (including channel init) and lost double buffering.&lt;/p&gt;
&lt;p&gt;So, what is the recommended way to RESTART the ADC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81605?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 13:35:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f368268-ea2b-4742-a741-b7b0ed0719f2</guid><dc:creator>Michael</dc:creator><description>&lt;p&gt;Thanks Jørgen.&lt;/p&gt;
&lt;p&gt;I managed to alleviate the problem greatly by using only &lt;code&gt;nrf_drv_timer_disable()&lt;/code&gt; without calling &lt;code&gt;nrf_drv_saadc_abort()&lt;/code&gt; as I did before.&lt;/p&gt;
&lt;p&gt;However, when I try to increase the sampling rate to 12.5 KSPS and even 10 KSPS, while still maintaining a decimation factor of 8, I can see the channel shifting in real time - even without start/stop (using a monitoring application on an android phone).&lt;/p&gt;
&lt;p&gt;With 8 KSPS, using only the timer to start/stop/ I haven&amp;#39;t seen this yet, but maybe the bug just needs more time to manifest itself...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [nRF52832] How to start/stop SAADC the right way?</title><link>https://devzone.nordicsemi.com/thread/81604?ContentTypeID=1</link><pubDate>Wed, 29 Mar 2017 13:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1f526e7-e631-4a67-830c-10caf6942612</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Do you only see the shifted buffer if you stop the stop and start the SAADC? Some other users &lt;a href="https://devzone.nordicsemi.com/question/119588/offset-in-saadc-samples-with-easy-dma-and-ble/"&gt;have reported swapped/shifted buffers when doing BLE activity&lt;/a&gt;. I see that there is a similar problem described in &lt;a href="https://devzone.nordicsemi.com/question/97728/saadc-scan-mode-sample-order-is-not-always-consistent/?answer=97783#post-id-97783"&gt;this thread&lt;/a&gt;, but it does not provide a solution. I will see if I can look further into this.&lt;/p&gt;
&lt;p&gt;In general, &lt;code&gt;nrf_drv_saadc_uninit()&lt;/code&gt; should be used to stop the SAADC. You could also try first stopping the timer calling the sample task, wait for the SAADC to be done (check using &lt;code&gt;nrf_drv_saadc_is_busy()&lt;/code&gt; and then call &lt;code&gt;nrf_drv_saadc_uninit()&lt;/code&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>