<?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>SAADC in blocking mode without activating the DMA</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39208/saadc-in-blocking-mode-without-activating-the-dma</link><description>Hi, 
 I need to use the SAADC to check battery status (infrequently). 
 I would like to do this in blocking mode without accidently leaving the easyDMA powered-on unnecessarily. 
 It seems that &amp;quot;nrf_drv_saadc_sample_convert&amp;quot; is the function to use. It</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Oct 2018 14:19:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39208/saadc-in-blocking-mode-without-activating-the-dma" /><item><title>RE: SAADC in blocking mode without activating the DMA</title><link>https://devzone.nordicsemi.com/thread/151862?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 14:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:532e0a31-a7c1-4178-97ec-09bc6b682eb0</guid><dc:creator>Daniel Reisfeld</dc:creator><description>&lt;p&gt;Einar thanks! I fully understand your argument and will implement accordingly,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Daniel&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC in blocking mode without activating the DMA</title><link>https://devzone.nordicsemi.com/thread/151853?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 13:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f32626f-918d-4611-ba46-8a10dab4e125</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi Daniel,&lt;/p&gt;
&lt;p&gt;I do not fully understand the reasoning for wanting to use blocking mode. The SAADC does not have any other way of transferring samples to memory than DMA, so this is still used for the blocking API. The only difference is that the driver will busy wait (keeping the CPU active and waysting power and/or preventing the CPU from doing other useful stuff) instead of sleeping. I do not see any practical benefit of this in an end application, though it can be slightly simpler&amp;nbsp;for fast experimentation or similar.&lt;/p&gt;
&lt;p&gt;For the specific questions:&lt;/p&gt;
&lt;p&gt;1) Yes, the&amp;nbsp;nrf_drv_saadc_sample_convert() is a blocking function call that will return when there is a valid sample. You must always configure the channel first with&amp;nbsp;nrf_drv_saadc_sample_convert(), which is where you configure most parameters (gain, acquisition time etc.).&lt;/p&gt;
&lt;p&gt;2) You must call&amp;nbsp;nrf_drv_saadc_init() once before you can call any other nrf_drv_saadc_* functions (and again if you have previously called&amp;nbsp;nrfx_saadc_uninit()).&lt;/p&gt;
&lt;p&gt;3) Yes, you should call&amp;nbsp;nrf_drv_saadc_uninit() when you are done to disable the SAADC peripheral so that it does not draw any current or request any other resources (such as the high frequency clock).&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>