<?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 scans only one sample</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52253/saadc-scans-only-one-sample</link><description>Hello, 
 I am developing a solution that measures values on 2 AIN channels in scan mode with the following setup: 
 - differential mode 
 - no oversampling 
 - no burst mode 
 - 10 bit precision 
 - resistors disabled 
 The channels are configured standard</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Oct 2019 11:56:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52253/saadc-scans-only-one-sample" /><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212988?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 11:56:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33eb2892-820a-4e07-b57b-9843ef00952a</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;The length of the scan is determined by the number of enabled channels. If you have 2 enabled channels a single triggered SAMPLE task will take one sample from each channel. If your buffer size is larger than 2 you will need to trigger the SAMPLE task enough time to fill the provided buffer, at which point an END event is triggered.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212937?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 08:30:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35152c77-5db5-47bf-a188-5d4f57e90ebd</guid><dc:creator>Peter.J</dc:creator><description>&lt;p style="text-align:left;"&gt;Hello Haakonsh,&lt;/p&gt;
&lt;p style="text-align:left;"&gt;thanx for your feedback. This I havent understood from the examples. There is not so much difference if I set the buffer size 2 or any multiple of 2 (in my case of 2 channels). Either the buffer is emptied every sample call or after the last sample call all at once.&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;My understanding was the size of the buffer determines lengthof the scan.&amp;nbsp;&lt;/p&gt;
&lt;p style="text-align:left;"&gt;So I should trigger the next scan when the previous one iscompleted. I dont call buffer convert in between. Correct?&lt;/p&gt;
&lt;p style="text-align:left;"&gt;peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212926?ContentTypeID=1</link><pubDate>Wed, 02 Oct 2019 07:59:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:487e755f-eb1d-4a4a-848d-fa28eaad2660</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;You need to trigger the sample task twice to fill the buffers now, otherwise, you will never get an END event.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;One SAMPLE task will sample all enabled channels once.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212856?ContentTypeID=1</link><pubDate>Tue, 01 Oct 2019 15:03:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d046ca00-8f0c-42b3-b82b-09b9af7d6e52</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Haakonsh,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I call&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; err_code = nrf_drv_saadc_buffer_convert(m_resistivity_measurement_buffer_pool, SAADC_SAMPLES_IN_BUFFER);&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;where&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;static nrf_saadc_value_t m_resistivity_measurement_buffer_pool[SAADC_SAMPLES_IN_BUFFER];&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SAADC_SAMPLES_IN_BUFFER I set 2 resp 4. I scan 2 channels.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I trigger&amp;nbsp; nrf_drv_saadc_sample() once right after the buffer convert call.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;peter&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212855?ContentTypeID=1</link><pubDate>Tue, 01 Oct 2019 14:46:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5955e4f-a61e-4d06-a376-183df0b38134</guid><dc:creator>haakonsh</dc:creator><description>[quote user="Peter.J"]When I increase size of the buffer to 4 then it gets stuck.[/quote]
&lt;p&gt;I need to know exactly what&amp;#39;s changed, how do you increase the buffer size?&amp;nbsp;&lt;/p&gt;
[quote user="Peter.J"]I recap that I am running Saadc low power mode as it only triggers scan task software way[/quote]
&lt;p&gt;&amp;nbsp;How many times do you trigger the SAMPLE task?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212689?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 23:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f6ef192-47d9-4685-b870-d407fa1ec39a</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Haakonsh,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am checking the callback function by setting up a flag when called. I check the flag then outside on upper level.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I stepped into scan investigation again. I used logging level for finding out results of calls.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am scanning 2 channels. When the buffer size was set 2, &amp;quot;scan&amp;quot; worked. I could see log:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;lt;info&amp;gt; saadc: Function: 233084, buffer length: 2, active channels: 2.&lt;br /&gt;&amp;lt;info&amp;gt; saadc: Function: nrf_drv_saadc_buffer_convert, error code: NRF_SUCCESS.&lt;br /&gt;&amp;lt;debug&amp;gt; app: Saadc init 0 saadc_battery_and_temperature_handler error code: NRF_SUCCESS&lt;br /&gt;&amp;lt;debug&amp;gt; saadc: Event: NRF_SAADC_EVENT_STARTED.&lt;br /&gt;&amp;lt;info&amp;gt; saadc: Function: nrf_drv_saadc_sample, error code: NRF_SUCCESS.&lt;br /&gt;&amp;lt;debug&amp;gt; saadc: Event: NRF_SAADC_EVENT_END.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When I increase size of the buffer to 4 then it gets stuck. The callback is not called as scan is not finished.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I recap that I am running Saadc low power mode as it only triggers scan task software way - when e.g. PPi is not used (see my explanation earlier).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any idea what I should check?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;peter&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212639?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 14:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cd98891-d768-4e42-82b5-fd60ce7daf27</guid><dc:creator>haakonsh</dc:creator><description>[quote user="Peter.J"]I dont see calibrate to call callback function with NRF_DRV_SAADC_EVT_CALIBRATEDONE event and also any other. [/quote]
&lt;p&gt;&amp;nbsp;That&amp;#39;s strange, it should work. How, exactly, do you make sure that you&amp;#39;ve entered the callback?&lt;/p&gt;
[quote user="Peter.J"]Before, all the registers were 0, while after the EVENTS_STARTED 0x100 was 1. Is this according to expectations?[/quote]
&lt;p&gt;I&amp;#39;m not 100% sure the calibration task triggers a started event, but it would not surprise me if it did.&amp;nbsp;If it does not then it means that something else in your application is triggering the start task of the SAADC while you&amp;#39;re calibrating.&amp;nbsp;&lt;/p&gt;
[quote user="Peter.J"]is&amp;nbsp;nrf_drv_saadc_buffer_convert() not needed for the calibration?[/quote]
&lt;p&gt;Nope.&amp;nbsp;&lt;/p&gt;
[quote user="Peter.J"]the calibration is valid for all ADC channels or only for those that are initialiazed? When I init another channel after calibration should i run calibration for those channels again?[/quote]
&lt;p&gt;&amp;nbsp;The calibration is independent of the input channels and is valid for all channels.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212602?ContentTypeID=1</link><pubDate>Mon, 30 Sep 2019 12:44:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a5dfb7b-3fea-4ec0-be2a-ac1e7f889fe4</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Haakonsh,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I followed your suggestion: called&amp;nbsp;saadc_calibrate(), no&amp;nbsp;nrf_drv_saadc_buffer_convert calling before that. Abort worked on the first call, as SAADC was idle.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I dont see calibrate to call callback function with NRF_DRV_SAADC_EVT_CALIBRATEDONE event and also any other. I called&amp;nbsp;saadc_get_registers() function right before and after calling&amp;nbsp;saadc_calibrate(), function. Before, all the registers were 0, while after the EVENTS_STARTED 0x100 was 1. Is this according to expectations?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When I added&amp;nbsp;NRF_LOG_DEBUG() print function after the calibration call, the callback was called. As&amp;nbsp;NRF_LOG_DEBUG calls an interrupt I suspect that this helped the callback to be called. I think there is something with interrupt settings not working correctly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Two&amp;nbsp;additional questions:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; - is&amp;nbsp;nrf_drv_saadc_buffer_convert() not needed for the calibration?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;- the calibration is valid for all ADC channels or only for those that are initialiazed? When I init another channel after calibration should i run calibration for those channels again?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;peter&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/212203?ContentTypeID=1</link><pubDate>Fri, 27 Sep 2019 08:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a2dc01f-0ff5-4d3c-916f-f24658155ae7</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Try this:&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;ret_code_t saadc_calibrate(void) {
    ret_code_t err_code;

    while(nrf_drv_saadc_is_busy())
    {
        nrf_drv_saadc_abort(); // Abort any SAADC activity, puts the driver in NRF_SAADC_STATE_IDLE. 
    }

    err_code = nrf_drv_saadc_calibrate_offset();
	NRF_LOG_DEBUG(&amp;quot;Saadc calibrate %s error code: %s&amp;quot;, (uint32_t)__func__, (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code));

    while(nrf_drv_saadc_is_busy())
    { 
        // Wait for calibration to complete
    }
    
    return err_code;
}


&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;NB:&amp;nbsp;&lt;br /&gt;After you&amp;#39;ve called&amp;nbsp;&lt;a title="nrf_drv_saadc_buffer_convert" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__drv__saadc.html?cp=5_1_6_9_0_28_0_2#ga6df4cb98bb337d1fcd6d8cf7ff0d3670"&gt;nrf_drv_saadc_buffer_convert&lt;/a&gt;&amp;nbsp;the SAADC driver is in&amp;nbsp;NRF_SAADC_STATE_BUSY as it is waiting for the Sample task to be triggered. The SAADC will be in&amp;nbsp;&lt;span&gt;NRF_SAADC_STATE_BUSY until the buffer has been filled with samples and you&amp;#39;ve gotten a callback in main.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/211928?ContentTypeID=1</link><pubDate>Thu, 26 Sep 2019 00:11:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6980ead5-c32a-4c75-a2af-98e474fbcc1c</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Haakonsh,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I understand that eclipse is not the favorite IDE for the nRF. There is not so much support / up to date. I tried to setup debugger but ended up with the device packages not working. Switching to Segger studio is not an option for me at this stage of the project.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I decided to go other way to get SAADC registers. I implemented a simple function that gets registers values:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void saadc_get_registers(uint32_t * registers) {
	uint32_t * p;

	p =  (uint32_t *)NRF_SAADC_BASE;

	registers[0] = p[0];
	registers[1] = p[1];
	registers[2] = p[2];
	registers[3] = p[3];

	p += 0x100;

	registers[4] = p[0];
	registers[5] = p[1];
	registers[6] = p[2];
	registers[7] = p[3];
	registers[8] = p[4];
	registers[9] = p[5];
}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The register values then I print at other point,&amp;nbsp;on the main level. Please, let me know if this approach is viable.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The other question I would like to ask, is I believe very close related to the SAADC scan. The first thing I am trying to do is calibration. I implemented a simple code:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;ret_code_t saadc_calibrate(void) {
    ret_code_t err_code;

    err_code = nrf_drv_saadc_buffer_convert(m_battery_measurement_buffer[0], SAADC_BATTERY_SAMPLE_COUNT); 
	NRF_LOG_DEBUG(&amp;quot;Saadc init 0 %s error code: %s&amp;quot;, (uint32_t)__func__, (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code));

    err_code = nrf_drv_saadc_buffer_convert(m_battery_measurement_buffer[1], SAADC_BATTERY_SAMPLE_COUNT);
	NRF_LOG_DEBUG(&amp;quot;Saadc init 1 %s error code: %s&amp;quot;, (uint32_t)__func__, (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code));

    while((err_code = nrf_drv_saadc_calibrate_offset()) != NRF_SUCCESS);
	NRF_LOG_DEBUG(&amp;quot;Saadc calibrate %s error code: %s&amp;quot;, (uint32_t)__func__, (uint32_t)NRF_LOG_ERROR_STRING_GET(err_code));

    return err_code;
}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The saadc_calibrate() function is called at the beginning of the main, no library is called before (besides log init) in order to avoid any influences.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Surprisingly, I found out that the&amp;nbsp;nrf_drv_saadc_calibrate_offset() always returns&amp;nbsp;NRF_ERROR_BUSY result. I am not sure if that is a result of&amp;nbsp; the buffer convert called before?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My understanding is that if calibration doesnt work then also scan doesnt work. This way I may come to the root cause for scan not working?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;peter&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/211761?ContentTypeID=1</link><pubDate>Wed, 25 Sep 2019 10:33:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9e13f03-4bc5-4124-a017-173249f14ab3</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;I don&amp;#39;t know Eclipse, but you should be able to view the peripheral registers. Usually the IDE uses the target ARM device&amp;#39;s SVD file to create a register map that&amp;#39;s easily viewable.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If Eclipse does not have this functionality then I suggest you try Segger Embedded Studios, as we provide our customers with a free license for development on our devices.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/211591?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 15:09:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65d3e7df-6a17-4bc5-bbf5-46213701a80e</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;Eclipse and Segger Jlink.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/211581?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 14:21:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe6c0096-7e60-421f-b1c5-5622814076ab</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What IDE are you using?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The gist of it is just to halt the CPU after you&amp;#39;ve started &lt;span&gt;RTC2, and read the state of the SAADC registers in RAM. See&amp;nbsp;&lt;a title="  Registers  " href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=3_1_0_36_10#topic"&gt;Registers&lt;/a&gt;&amp;nbsp;for register addresses and their specs.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/211565?ContentTypeID=1</link><pubDate>Tue, 24 Sep 2019 13:25:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6077372d-f47c-40d4-935c-d188baae7420</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Haakonsh,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;can you advise me how to do that? Besides debugging.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;peter&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/211331?ContentTypeID=1</link><pubDate>Mon, 23 Sep 2019 14:39:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:430d30aa-fb05-469d-8530-fedcee4f2c48</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Hmm, maybe the DONE event interrupt is enabled or something.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Can you capture the state of the SAADC registers after you&amp;#39;ve initialized and started sampling?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/210800?ContentTypeID=1</link><pubDate>Fri, 20 Sep 2019 00:15:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0db9a32-f8ae-463d-b40e-0fbaeb725fbc</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;Hello Haakonsh,&lt;/p&gt;
&lt;p&gt;I tried SAADC_SAMPLES_IN_BUFFER with multiples of 2. Every 2 samples (1 and 1 on each channel) generate callback. I tried PPI and nrf timer driver as the first version (as one of the examples). The behavior was the same - I was getting multiple of callbacks depending on the buffer size. That&amp;#39;s the reason that I suspect some SDK config issue.&lt;/p&gt;
&lt;p&gt;Best regards, peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/210723?ContentTypeID=1</link><pubDate>Thu, 19 Sep 2019 13:19:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e3039bc-43f4-45ab-be26-dc410df1daa4</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;What&amp;#39;s the value of&amp;nbsp;SAADC_SAMPLES_IN_BUFFER?&lt;/p&gt;
&lt;p&gt;RTC0 is used by the SoftDevice and RTC1 is used by the app_timer in various libraries throughout the SDK.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Since you&amp;#39;re using the RTC to trigger the sample task I suggest you do it via PPI and not via an interrupt. See the PPI example for how one connects a peripheral event to a task.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/210518?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 17:38:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e680540-4e9f-4395-89e6-f3c90f17dd9c</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2234._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/210507?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 16:43:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e376fe79-4290-4dea-a106-103e471ec425</guid><dc:creator>Peter.J</dc:creator><description>&lt;p&gt;Hello Haakonsh,&lt;/p&gt;
&lt;p&gt;thanx for your feedback. I add relevant pieces of the code:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;static nrf_drv_saadc_config_t m_saadc_config =&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .low_power_mode = true,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .resolution = NRF_SAADC_RESOLUTION_10BIT,&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .oversample = NRF_SAADC_OVERSAMPLE_DISABLED,&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .interrupt_priority = APP_IRQ_PRIORITY_LOW&lt;/em&gt;&lt;br /&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;static nrf_saadc_channel_config_t m_saadc_channel_1_config =&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .reference = NRF_SAADC_REFERENCE_VDD4,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .gain = NRF_SAADC_GAIN1,&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .acq_time = SAADC_SCAN_ACQ_TIME,.// (10 us)&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .mode = NRF_SAADC_MODE_DIFFERENTIAL,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .pin_p = ADC_CHANNEL_1_PIN,.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .pin_n = ADC_CHANNEL_2_PIN,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .resistor_p = NRF_SAADC_RESISTOR_DISABLED,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; .resistor_n = NRF_SAADC_RESISTOR_DISABLED&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;};&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;similarly channel 2, except pins definitions&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;&lt;em&gt; err_code = nrf_drv_saadc_init(&amp;amp;m_saadc_config, saadc_callback);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;...&lt;/p&gt;
&lt;p&gt;&lt;em&gt;err_code = nrf_drv_saadc_channel_init(1, &amp;amp;m_saadc_channel_1_config);&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; err_code = nrf_drv_saadc_channel_init(2, &amp;amp;m_saadc_channel_2_config);&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;err_code = nrf_drv_saadc_buffer_convert(m_measurement_buffer_pool[0], SAADC_SAMPLES_IN_BUFFER);&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;em&gt; APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;err_code = nrf_drv_saadc_buffer_convert(m_measurement_buffer_pool[1], SAADC_SAMPLES_IN_BUFFER);&lt;/em&gt;&lt;br /&gt;&lt;em&gt; APP_ERROR_CHECK(err_code);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Then in RTC2 timer interrupt handler:&lt;/p&gt;
&lt;p&gt;&lt;em&gt; nrf_drv_saadc_sample();&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;SAADC callback:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;void saadc_callback(nrf_drv_saadc_evt_t const * p_event)&lt;/em&gt;&lt;br /&gt;&lt;em&gt;{&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; if (p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE)&lt;/em&gt;&lt;br /&gt;&lt;em&gt; { nrf_drv_saadc_buffer_convert(p_event-&amp;gt;data.done.p_buffer, SAADC_SAMPLES_IN_BUFFER);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;copying scanned data to an array for further processing&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suspect if some of the SDK configuration is correctly set. E.g. I dont have RTC1 enabled as when enabled the compiler gives an error of double definition of IRQ handler (or something similar). RTC1 is responsible for interrupts management, if I am not mistaken?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;peter&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC scans only one sample</title><link>https://devzone.nordicsemi.com/thread/210327?ContentTypeID=1</link><pubDate>Wed, 18 Sep 2019 09:16:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c01c0866-1721-4f4e-bdfd-62442c86ddc6</guid><dc:creator>haakonsh</dc:creator><description>[quote user=""]The channels are configured standard way using nrf_drv_saadc_channel_init() and&amp;nbsp;nrf_drv_saadc_buffer_convert(). I start conversion by calling&amp;nbsp;nrf_drv_saadc_sample() and set low power mode[/quote]
&lt;p&gt;&amp;nbsp;From Prod spec&amp;#39;s &lt;a title="Analog inputs and channels" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=3_1_0_36_3#saadc_inputs"&gt;Analog inputs and channels&lt;/a&gt;: &amp;quot;&lt;span&gt;Any one of the available channels can be enabled for the ADC to operate in one-shot mode. If more than one CH[n] is configured, the ADC enters scan mode.&amp;quot;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]This I understood to run several scan samples until buffer lasts.[/quote]
&lt;p&gt;From&amp;nbsp;&lt;a title="Scan mode" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=3_1_0_36_4_3#saadc_operationmodes_scan"&gt;Scan mode&lt;/a&gt;: &amp;quot;A channel is considered enabled if CH[n].PSELP is set. If more than one channel, CH[n], is enabled, the ADC enters scan mode.&lt;/p&gt;
&lt;p&gt;In scan mode, &lt;strong&gt;one SAMPLE task will trigger one conversion per enabled channel&lt;/strong&gt;.&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]I am not doing calibration at this stage, as it requires scan to work.[/quote]
&lt;p&gt;&amp;nbsp;You need to run calibration fairly often if you want accurate results.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I suggest you provide us with the relevant code so that we can see exactly what you&amp;#39;ve done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>