<?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>SAADSC event handler not called if buffer length &amp;gt; 1 (non-blocking mode)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37049/saadsc-event-handler-not-called-if-buffer-length-1-non-blocking-mode</link><description>Hi, 
 
 My freertos based application (SDK14.2) calls battery monitoring procedure every few minutes . 
 I&amp;#39;ve initialized the SAADC 
 
 
 Within the function I call 
 
 
 When BATT_AVG_FACTOR ==1 I get the SAADC event handler called immediately. 
 However</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 01 Aug 2018 15:45:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37049/saadsc-event-handler-not-called-if-buffer-length-1-non-blocking-mode" /><item><title>RE: SAADSC event handler not called if buffer length &gt; 1 (non-blocking mode)</title><link>https://devzone.nordicsemi.com/thread/142466?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 15:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22f92f40-0191-485b-8383-17db69b520e7</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;If you have an SAADC buffer with size of N you must call the sample function,&amp;nbsp;nrf_drv_saadc_sample() N times before you get a callback. Note that you need a certain delay between the two calls.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I once made a simple example (in SDK15.0.0 (!)) that triggers a sample task on a buttonpress. Take a look at it, and see if it makes any sense.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cd7c4f7b47f346a6b1bc6c3c5c338491/saadc_5F00_pin_5F00_int_5F00_change.zip"&gt;devzone.nordicsemi.com/.../saadc_5F00_pin_5F00_int_5F00_change.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I used Keil and nRF52832, so if you use something else, you might need to add some pats and files to the project in order to compile.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Alternatively, if I understand the point of BATT_AVG_FACTOR correctly, you can look into just setting this to 1, and use oversampling (set this in sdk_config.h).&lt;/p&gt;
&lt;p&gt;#define SAADC_CONFIG_OVERSAMPLE 0&lt;/p&gt;
&lt;p&gt;set this to N, and the SAADC module will do 2^N samplings and average it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADSC event handler not called if buffer length &gt; 1 (non-blocking mode)</title><link>https://devzone.nordicsemi.com/thread/142351?ContentTypeID=1</link><pubDate>Wed, 01 Aug 2018 10:31:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb6c00c8-b788-47e5-ae6e-c9b936631e17</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Some more info -&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;SAADC_CONFIG_LP_MODE == 1 - the behavior as described above&lt;/li&gt;
&lt;li style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;SAADC_CONFIG_LP_MODE == 0&amp;nbsp;
&lt;ul&gt;
&lt;li style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;If BATT_AVG_FACTOR == 1, works as expected&lt;/li&gt;
&lt;li style="background-color:transparent;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;"&gt;If BATT_AVG_FACTOR == 2 , does NOT get to SAADC_IRQHandler() even once !&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>