<?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>Checking the ADC value range with SAADC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/51136/checking-the-adc-value-range-with-saadc</link><description>OS in development environment ：Windows7 HARD :(Taiyo Yuden)EBSHSN Series Evaluation Board : Central / Peripherals CPU :(Nordic) nRF52832 / ARMR Cortex-M4F 32 bit processor 28-pin Land Grid Array / 15GPIOs / SWD Soft Ver:nRF5_SDK_15.2.0_9412b96 CPU Vcc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 20 Aug 2019 12:08:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/51136/checking-the-adc-value-range-with-saadc" /><item><title>RE: Checking the ADC value range with SAADC</title><link>https://devzone.nordicsemi.com/thread/205016?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 12:08:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff1171e3-6ad3-45d7-bb6a-29ce1dccafa2</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It appears you are mostly using default SAADC settings, which means you are using the internal 0.6V reference, and a gain setting of 1/6.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can calculate the voltage of the measured signal like this: Voltage = ADC_reading / 2^12 * INT_REF / GAIN&lt;/p&gt;
&lt;p&gt;In your case this equals&amp;nbsp;3.003V, which seems pretty accurate if your voltage is supposed to be 3V.&lt;/p&gt;
&lt;p&gt;In other words I think the ADC is working as intended &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;If you want the ADC scale to be 0-0xFFF for 0-VDD then you shoult set the internal reference to VDD1_4 and the gain setting to GAIN1_4, as described in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=3_1_0_36_10_7#register.CH-0.CONFIG"&gt;product specification&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checking the ADC value range with SAADC</title><link>https://devzone.nordicsemi.com/thread/204886?ContentTypeID=1</link><pubDate>Tue, 20 Aug 2019 02:47:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce2cc3e9-7efd-4f14-8519-2e446469b56c</guid><dc:creator>yokokawa</dc:creator><description>&lt;p&gt;void saadc_init(void)&lt;br /&gt;{&lt;br /&gt; ret_code_t err_code;&lt;br /&gt;/*-&amp;lt; SAADC Register initial parameter &amp;gt;-*/&lt;br /&gt; nrf_drv_saadc_config_t saadc_config = NRF_DRV_SAADC_DEFAULT_CONFIG; /* SET to SAADC Data area or initial data */&lt;/p&gt;
&lt;p&gt;/*-&amp;lt; SAADC Channel Setting parameter &amp;gt;-*/&lt;br /&gt; nrf_saadc_channel_config_t channel0_config =&lt;br /&gt; NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN2); /* Channel 2 [Fingertip pulse wave] data */&lt;br /&gt; nrf_saadc_channel_config_t channel2_config =&lt;br /&gt; NRF_DRV_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN0); /* Channel 0 [pulse wave] data */&lt;/p&gt;
&lt;p&gt;/*-&amp;lt; SAADC initial &amp;gt;-*/&lt;br /&gt; err_code = nrf_drv_saadc_init(&amp;amp;saadc_config, saadc_callback); &lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;/*-&amp;lt;ADC offset calibration &amp;gt;-*/&lt;br /&gt; err_code = nrfx_saadc_calibrate_offset();&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; while(nrfx_saadc_is_busy()) // Wait for calibration to complete&lt;br /&gt; {&lt;br /&gt; __WFE(); //&lt;br /&gt; __SEV(); //&lt;br /&gt; __WFE(); // This sequence puts the system to sleep (SystemON) while waiting&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;/*-&amp;lt; SAADC Channel Setting &amp;gt;-*/&lt;br /&gt; err_code = nrf_drv_saadc_channel_init(0, &amp;amp;channel0_config); /*Channel 0 setting */&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; err_code = nrf_drv_saadc_channel_init(2, &amp;amp;channel2_config); /*Channel 2 setting */&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;/*-&amp;lt;SAADC double baffer Setting &amp;gt;-*/&lt;br /&gt; err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[0], SAADC_SAMPLES_IN_BUFFER); /* 1st buffer setting */&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; err_code = nrf_drv_saadc_buffer_convert(m_buffer_pool[1], SAADC_SAMPLES_IN_BUFFER); /* 2nd buffer setting */&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Checking the ADC value range with SAADC</title><link>https://devzone.nordicsemi.com/thread/204800?ContentTypeID=1</link><pubDate>Mon, 19 Aug 2019 13:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0764119d-9aad-4bfc-b679-ca69f256208f</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Could you send me the SAADC configuration parameters that you use when you initialize it?&lt;/p&gt;
&lt;p&gt;Depending on how you have configured the internal reference, which gain settings you are using etc, VDD might not correspond to 0xFFF.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>