<?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 using sdk example didn&amp;#39;t give the right value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18772/adc-using-sdk-example-didn-t-give-the-right-value</link><description>Hello, I try to run the sdk example for adc, i set an input voltage in varying from 0 to 4.38 V in the pin 4 (AIN2), but the returned value didn&amp;#39;t corresponds to the desired value, and also did&amp;#39;nt vary when I vary the input voltage.
I use sdk version</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Jan 2017 16:14:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18772/adc-using-sdk-example-didn-t-give-the-right-value" /><item><title>RE: adc using sdk example didn't give the right value</title><link>https://devzone.nordicsemi.com/thread/72502?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2017 16:14:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f646d495-36e2-4338-9a88-df987c88ddee</guid><dc:creator>acha</dc:creator><description>&lt;p&gt;Ah! that&amp;#39;s was the problem, I applied a tension between 0 and 5V (~4.38V) instead of 0 ~ 3.3V. Now it&amp;#39;s better ;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adc using sdk example didn't give the right value</title><link>https://devzone.nordicsemi.com/thread/72501?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2017 15:27:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bdd8f67-c19a-4ccc-ac5a-fc8aea84666e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Input voltage of 0 should give a result of ~0. Are you sure this is what you are applying? What is the operating voltage (VDD) of your nRF IC? The input range of the SAADC should be from 0 to VDD.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adc using sdk example didn't give the right value</title><link>https://devzone.nordicsemi.com/thread/72500?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2017 15:07:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:abd96d9b-23a8-42d1-b83b-c751c312bb60</guid><dc:creator>acha</dc:creator><description>&lt;p&gt;thanks you for your answer, i tought that the function takes the number of of AINx. However, when my input voltage vary from 0 to 4.38V, the resulting value of adc increase to 899 and then decrease to 512. I dont understand why ? :O&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: adc using sdk example didn't give the right value</title><link>https://devzone.nordicsemi.com/thread/72499?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2017 15:00:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee17119b-3a55-4b24-b025-94cdc58e8e0c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You say you &lt;em&gt;&amp;quot;set an input voltage in varying from 0 to 4.38 V in the pin 4 (AIN2)&amp;quot;&lt;/em&gt;, but in your code you initialize the channel with &lt;code&gt;nrf_drv_saadc_gpio_to_ain(2)&lt;/code&gt;. The SAADC channel will then be on GPIO pin 2 (AIN0). If you want to use AIN2 (pin 4), you should initialize the channel using &lt;code&gt;nrf_drv_saadc_gpio_to_ain(4)&lt;/code&gt;. You can also use the defines &lt;code&gt;NRF_SAADC_INPUT_AIN0&lt;/code&gt; to &lt;code&gt;NRF_SAADC_INPUT_AIN7&lt;/code&gt; directly.&lt;/p&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>