<?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>ADC Sequential Read Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25458/adc-sequential-read-issue</link><description>I&amp;#39;m having an issue when trying to perform sequential reads with the ADC on 4 different pins. I&amp;#39;ve setup a timer to trigger every 1 second. In the Timer0 IRQ I setup the ADC for the first pin, and start a read using NRF_ADC-&amp;gt;TASKS_START = 1; 
 Then in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Sep 2017 16:50:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25458/adc-sequential-read-issue" /><item><title>RE: ADC Sequential Read Issue</title><link>https://devzone.nordicsemi.com/thread/100344?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2017 16:50:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb8480bb-7eae-4ecb-91b2-74b9257adcec</guid><dc:creator>phipi</dc:creator><description>&lt;p&gt;That makes perfect sense, and I definitely missed that. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Sequential Read Issue</title><link>https://devzone.nordicsemi.com/thread/100343?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2017 15:33:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4be7ada1-8402-47a6-81f6-795e36085300</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The reason why you see this behaviour is that you do not clear the allready set analog input when you configure the new input. Your code will enable one channel after another, until all your channels is enabled:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_ADC-&amp;gt;CONFIG |= (pin_number &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;What you need to do is to clear the previous channel before configuring a new channel:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_ADC-&amp;gt;CONFIG &amp;amp;= (~ADC_CONFIG_PSEL_Msk);
NRF_ADC-&amp;gt;CONFIG |= (pin_number &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Your code works because you clear the whole config when you set the resolution in &lt;code&gt;ADC_pin_configure&lt;/code&gt; (by using the &lt;code&gt;=&lt;/code&gt; sign, rather than &lt;code&gt;|=&lt;/code&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_ADC-&amp;gt;CONFIG = ((ADC_CONFIG_RES_10bit &amp;lt;&amp;lt; ADC_CONFIG_RES_Pos) &amp;amp; ADC_CONFIG_RES_Msk);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>