<?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 value in nrf52805</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65613/reading-adc-value-in-nrf52805</link><description>I want to read ADC values from AIN2 (P0.04), and AIN3 (P0.05) channels of nrf52805. I am using S112, and I have the following code found in the internet. 
 float readADC(uint8_t channel) { volatile int16_t result = 0; volatile float precise_result = 0;</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Sep 2020 06:36:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65613/reading-adc-value-in-nrf52805" /><item><title>RE: Reading ADC value in nrf52805</title><link>https://devzone.nordicsemi.com/thread/268178?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2020 06:36:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43ea4cc8-93c9-4c34-9bb9-653eb792603b</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]I have the following code found in the internet.[/quote]
&lt;p&gt;Where is this code from?&lt;/p&gt;
[quote user=""]The voltage input on both channels is 1.2V.[/quote]
&lt;p&gt;How have you verified / set this up? Have you measured the voltage input to the channels with an external multimeter / oscilloscope?&lt;br /&gt;&lt;br /&gt;It seems to me that you are never setting the channels to point to your AIN2 and AIN3 pins - you are using different channels, but both channels are set up to measure VDD.&lt;br /&gt;What is your VDD, by the way?&lt;br /&gt;Is there a particular reason for why you would like to manipulate the registers directly, instead of using the nrfx driver or legacy driver?&lt;br /&gt;I would highly recommend making use of the drivers, since they do all this ground work for you - so that you do not have to look into every register yourself.&lt;br /&gt;&lt;br /&gt;For future reference, please use the &amp;quot;Insert -&amp;gt; Code&amp;quot; option when sharing code in the forum for increased readability.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reading ADC value in nrf52805</title><link>https://devzone.nordicsemi.com/thread/268152?ContentTypeID=1</link><pubDate>Sun, 06 Sep 2020 09:28:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:242fcb90-3ddf-4070-b712-15ba1499abbb</guid><dc:creator>rmptxf</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Here is a simpler SAADC example to look into for configuring channels, and read adc measurements also converting that to voltage measurements.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/rmptxf/nrf52_saadc_simplified"&gt;https://github.com/rmptxf/nrf52_saadc_simplified&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;rmptxf&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>