<?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>Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93672/get-weird-value-back-when-read-adc</link><description>Some time I&amp;#39;ll got wrong value from read ADC. 
 I am using ncs2.0.2. 
 Here is my debug message you can see huge value at adc port 2. 
 
 Here is how I define ADC node in DTS. 
 
 Here is my full code</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Nov 2022 09:20:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93672/get-weird-value-back-when-read-adc" /><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/395259?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2022 09:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2349d869-d61e-468c-a987-1bac456b6004</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Glad to hear that it works now. Yes, the voltage will fluctuate if you leave the input floating. It should become stable if you connect it to ground or VDD.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/395256?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2022 09:16:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:056fa2f8-a4bd-49f5-b4ca-8721ad0e2112</guid><dc:creator>Wols</dc:creator><description>&lt;p&gt;I&amp;nbsp;&lt;span&gt;expected it should be zero, I leave it in the air, I think that is why I got negative voltage.&lt;br /&gt;&lt;br /&gt;By the way, this two node is necessary in DTS on 2.1.2.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;		zephyr,acquisition-time = &amp;lt;ADC_ACQ_TIME_DEFAULT&amp;gt;;
		zephyr,input-positive = &amp;lt;NRF_SAADC_AIN3&amp;gt;;&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I just move my project to 2.1.2, and rewritten adc part as your example, it works well now, thanks.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/395238?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2022 08:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db5677e3-2d25-4484-88ad-41ddde5d3d03</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;What is the expected voltage on the channel 2 input? Is it tied to ground?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/395221?ContentTypeID=1</link><pubDate>Fri, 11 Nov 2022 03:42:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c366bf6-a48b-4172-bbd6-63d7f733b282</guid><dc:creator>Wols</dc:creator><description>&lt;p&gt;Sorry for lat reply, this example work for me on 2.1.2&lt;br /&gt;&lt;br /&gt;Some time adc@40007000, channel 2 got&amp;nbsp;negative voltage, but it&amp;#39;s better than now what happened on my board at 2.0.2.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try to move the project to 2.1.2 and see what will happen, thank you Vidar.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;adc@40007000, channel 2: -3 = -3 mV 
adc@40007000, channel 2: -1 = -1 mV &lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/394875?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 10:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4837019-4ffd-4abf-a779-05e31dac770f</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Alternatively, you can try to just remove the &amp;quot;zephyr,acquisition-time = &amp;lt;ADC_ACQ_TIME_DEFAULT&amp;gt;;&amp;quot; lines from your overlay and see if it is enough to let you build the sample.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/394871?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 10:15:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a612b63-d927-44fa-9527-6853b1e6c64b</guid><dc:creator>Wols</dc:creator><description>&lt;p&gt;Well&lt;br /&gt;&lt;br /&gt;I would like to have a try but need some time.&lt;/p&gt;
&lt;p&gt;If any updates I&amp;#39;ii that you know of, thanks : )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/394870?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 10:08:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:539ddc44-16f8-4057-9869-4ddfa6f4f837</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I forgot to add that my sample was tested with SDK v2.1.2. Are you able to try with this version instead?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/394857?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 09:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:086e8493-4726-495c-8030-600cf8c5f046</guid><dc:creator>Wols</dc:creator><description>&lt;p&gt;Sorry,&lt;/p&gt;
&lt;p&gt;I got a error like this.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s a include problem, there is no any like define in my ncs2.0.2 folder.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;adc_52832/nrf52dk_nrf52832.overlay:35 (column 30): parse error: expected number or parenthesized expression&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;	35 zephyr,acquisition-time = &amp;lt;ADC_ACQ_TIME_DEFAULT&amp;gt;;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Get weird value back when read ADC</title><link>https://devzone.nordicsemi.com/thread/394729?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2022 14:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2789d796-1d83-451f-b760-4cf75501584b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I did not manage to reproduce this here with a test sample I made based on the ADC driver sample. Please try this sample and see if you get the same result.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ADC demo sample&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1884.adc_5F00_nrf52dk_5F00_nrf52832.zip"&gt;devzone.nordicsemi.com/.../1884.adc_5F00_nrf52dk_5F00_nrf52832.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Expected log output&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;pre class="ui-code" data-mode="text"&gt;ADC reading:
- ad007000, channel 0: 230 = 202 m
- adc@40007000, channel 1: 174 = 152 mV
- adc@40007000, channel 2: 8 = 7 mV
- adc@40007000, channel 3: 121 = 106 mV
- adc@40007000, channel 4: 181 = 159 mV
ADC reading:
- adc@40007000, channel 0: 191 = 167 mV
- adc@40007000, channel 1: 185 = 162 mV
- adc@40007000, channel 2: 26 = 22 mV
- adc@40007000, channel 3: 121 = 106 mV
- adc@40007000, channel 4: 187 = 164 mV
ADC reading:
- adc@40007000, channel 0: 158 = 138 mV
- adc@40007000, channel 1: 200 = 175 mV
- adc@40007000, channel 2: 22 = 19 mV
- adc@40007000, channel 3: 129 = 113 mV
- adc@40007000, channel 4: 198 = 174 mV
ADC reading:
- adc@40007000, channel 0: 127 = 111 mV
- adc@40007000, channel 1: 166 = 145 mV
- adc@40007000, channel 2: 18 = 15 mV
- adc@40007000, channel 3: 144 = 126 mV
- adc@40007000, channel 4: 194 = 170 mV
...&lt;/pre&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>