<?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>Reading ADC with a double buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33723/reading-adc-with-a-double-buffer</link><description>Hi, 
 
 I have a question about ADC reading in ble_app_uart__saadc_timer_driven__scan_mode in SDK 14. 
 Let&amp;#39;s say I&amp;#39;m using a double buffer, and I have 3 ADC channels (so SAADC_SAMPLES_IN_BUFFER=3 ) 
 Now I look in p_event-&amp;gt;data.done.p_buffer[ i ] . Is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Apr 2018 09:38:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33723/reading-adc-with-a-double-buffer" /><item><title>RE: Reading ADC with a double buffer</title><link>https://devzone.nordicsemi.com/thread/130250?ContentTypeID=1</link><pubDate>Mon, 30 Apr 2018 09:38:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc1523df-4934-4345-9d1a-19f1ff85fda1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Did you measure the same source with all three pins, or was channel 1 measuring something else?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What chip do you use? nRF52832 or nRF52840?&lt;/p&gt;
&lt;p&gt;And you say that you used SDK14. Is that SDK14.0.0, SDK14.1.0 or SDK14.2.0?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading ADC with a double buffer</title><link>https://devzone.nordicsemi.com/thread/130190?ContentTypeID=1</link><pubDate>Sun, 29 Apr 2018 05:34:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f923cc2c-17de-4650-89cc-3da20ad68a9b</guid><dc:creator>Alaa</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Yes, channel_config settings for 0,1,2 were the same like appears in the code I posted.&lt;/p&gt;
&lt;p&gt;And about oversampling, I just changed the variable&amp;nbsp;SAADC_CONFIG_OVERSAMPLE in sdk_config.h to 2. Do I have to do anything else to turn it on correctly?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading ADC with a double buffer</title><link>https://devzone.nordicsemi.com/thread/129992?ContentTypeID=1</link><pubDate>Thu, 26 Apr 2018 14:17:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fcecbc5-0b1a-452d-bf38-c5d0c249b3a1</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Oversampling should not cause a higher value. When the error occured, did you have oversampling on all the channels, or only one of them? And in addition to oversampling, was the rest of the channel_config settings the same?&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: Reading ADC with a double buffer</title><link>https://devzone.nordicsemi.com/thread/129892?ContentTypeID=1</link><pubDate>Thu, 26 Apr 2018 08:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e983f996-7778-45f0-870b-2bcdf714a98e</guid><dc:creator>Alaa</dc:creator><description>&lt;p&gt;3 different GPIOS (AIN0, AIN1, AIN2). And here&amp;#39;s the initialization:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    nrf_saadc_channel_config_t channel_0_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0);
    channel_0_config.gain = NRF_SAADC_GAIN1_6;
    channel_0_config.reference = NRF_SAADC_REFERENCE_VDD4;
	
    nrf_saadc_channel_config_t channel_1_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN1);
    channel_1_config.gain = NRF_SAADC_GAIN1_6;
    channel_1_config.reference = NRF_SAADC_REFERENCE_VDD4;
	
    nrf_saadc_channel_config_t channel_2_config =
        NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN2);
    channel_2_config.gain = NRF_SAADC_GAIN1_6;
    channel_2_config.reference = NRF_SAADC_REFERENCE_VDD4;
	
    err_code = nrf_drv_saadc_init(&amp;amp;saadc_config, saadc_callback);
    APP_ERROR_CHECK(err_code);

    err_code = nrf_drv_saadc_channel_init(0, &amp;amp;channel_0_config);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_saadc_channel_init(1, &amp;amp;channel_1_config);
    APP_ERROR_CHECK(err_code);
    err_code = nrf_drv_saadc_channel_init(2, &amp;amp;channel_2_config);
    APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I just disabled&amp;nbsp;&lt;strong&gt;OVERSAMPLING&lt;/strong&gt; and now it&amp;#39;s working well. Each channel looks independent now. Is there a way to make it work with oversampling enabled? Why would oversampling (of 4x) cause this behavior?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading ADC with a double buffer</title><link>https://devzone.nordicsemi.com/thread/129765?ContentTypeID=1</link><pubDate>Wed, 25 Apr 2018 12:38:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dac11cbb-646e-4066-8526-04cdbd49c534</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Do you have 3 different gpios measureing these values? Are they connected/shorted to anything? Or do you have one input GPIO, and it stores the values into three different sections in the buffer?&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></channel></rss>