<?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>Setting a GPIO pin as an analog input</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/36616/setting-a-gpio-pin-as-an-analog-input</link><description>Hi. I have the following code, I am attempting to read AIN0 on pin 4 (P0.02). 
 I am watching the result whilst debugging the application on DK52, and it is a random value fluctuating at about 0x336c even when I GND pin 4, i.e. reading should be 0x0000</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Oct 2020 14:01:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/36616/setting-a-gpio-pin-as-an-analog-input" /><item><title>RE: Setting a GPIO pin as an analog input</title><link>https://devzone.nordicsemi.com/thread/274366?ContentTypeID=1</link><pubDate>Mon, 12 Oct 2020 14:01:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:073b5d5d-0124-425e-bc24-b3f97f79fefa</guid><dc:creator>Felix</dc:creator><description>&lt;p&gt;for others coming here: you should use SAADC_CH_CONFIG_BURST_Enabled on line 15 above and not&amp;nbsp;SAADC_CH_PSELN_PSELN_AnalogInput0;&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting a GPIO pin as an analog input</title><link>https://devzone.nordicsemi.com/thread/140738?ContentTypeID=1</link><pubDate>Thu, 19 Jul 2018 18:36:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d2b5ca4-33a6-4938-acbe-d948ff84daa1</guid><dc:creator>Philip</dc:creator><description>&lt;p&gt;Oh I just spotted the issue. On line 25 I have selected VDD as the +ve input to the ADC it should be;&lt;/p&gt;
&lt;p&gt;NRF_SAADC-&amp;gt;CH[0].PSELP = SAADC_CH_PSELP_PSELP_AnalogInput0 &amp;lt;&amp;lt; SAADC_CH_PSELP_PSELP_Pos;&lt;/p&gt;
&lt;p&gt;Is working ok now. It is a bit different to a PIC ADC also, in that it is a differential ADC, so with the -ve set to GND, the output can go just below zero.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>