<?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>The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105120/the-results-of-nrf52840-adc-conversion-are-not-as-expected</link><description>I&amp;#39;m using PCA10040 for studying nRF SDK, and I tried running the sample &amp;#39;saadc_pc10040&amp;#39; with the following change in the &amp;#39;config.h&amp;#39;: 
 
 
 I connected the board to my PC via USB and applied an external power source with the negative terminal connected</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 15 Nov 2023 13:52:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105120/the-results-of-nrf52840-adc-conversion-are-not-as-expected" /><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/455785?ContentTypeID=1</link><pubDate>Wed, 15 Nov 2023 13:52:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25b51984-6c11-4113-8a3a-d374efa3fb3f</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Can you post your current application code and configuration?&lt;/p&gt;
&lt;p&gt;The SAADC sample in nRF5 SDK does not use offset calibration by default.&lt;/p&gt;
&lt;p&gt;The results from the SAADC is given as 2&amp;#39;s complement 16-bit values (corresponding to int16_t type). int16_t have a range between [-32768, +32767]. If you see values in the 62000 range, your data type is incorrect.&lt;/p&gt;
&lt;p&gt;You should not enable any other peripherals (e.g., GPIOTE) on the same pins used for SAADC input.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/455381?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 15:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19de45c4-8dbe-42cf-b6c7-b78d538febf8</guid><dc:creator>kkuma256</dc:creator><description>&lt;p&gt;Symptoms occur in 2 out of 4 units.&lt;/p&gt;
&lt;p&gt;Initially, during development, I recall that the issue was not present, but there is no recorded evidence, and my memory is the only basis, so it&amp;#39;s not definitive.&lt;/p&gt;
&lt;p&gt;When running the exact same program on different boards, the problem appears inconsistently for each board.&lt;/p&gt;
&lt;p&gt;In the test program (an adaptation of the saadc_pca10056 sample to work with KAGA&amp;#39;s board), it seems that calibration is not performed at all.&lt;/p&gt;
&lt;p&gt;Just to be sure, I placed a breakpoint in the following line in nrfx_sadc.c:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;    nrf_saadc_int_disable(NRF_SAADC_INT_END | NRF_SAADC_INT_CALIBRATEDONE);
=&amp;gt;  if (m_cb.adc_state == NRF_SAADC_STATE_CALIBRATION)
    {
        :
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;But when I broke into it, the condition (m_cb.adc_state == NRF_SAADC_STATE_CALIBRATION) did not hold.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/455274?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 11:52:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf79bb6b-73ee-4f38-9720-83b94a4a764e</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi, do not call &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__saadc.html#ga75bfde8a2350eb3ccc8892e725a9fb39"&gt;nrf_drv_saadc_calibrate_offset()&lt;/a&gt;/&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrfx__saadc.html#gabebf4b2245bff5bc767b0e679702708d"&gt;nrfx_saadc_calibrate_offset()&lt;/a&gt; and don&amp;#39;t trigger the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=5_0_0_5_22_8_3#register.TASKS_CALIBRATEOFFSET"&gt;TASKS_CALIBRATEOFFSET&lt;/a&gt;.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/455222?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 04:05:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b20e27b-446a-44bc-83aa-91ece99397fb</guid><dc:creator>kkuma256</dc:creator><description>&lt;p&gt;&lt;span&gt;How can I specifically disable calibration? I&amp;#39;ve looked into it briefly, but I&amp;#39;m not quite sure of the process. If you could provide a link to relevant documentation or any guidance, that would be appreciated.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/455077?ContentTypeID=1</link><pubDate>Fri, 10 Nov 2023 09:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0217f9a7-cd7a-4c96-8020-8867e2331f5e</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Do you only experience this on one device?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;And are you sure that you have not done any other changes to the code?&lt;br /&gt;&lt;br /&gt;The behavior that you see can come from the Errata related to calibration.&amp;nbsp;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_252.html?cp=5_0_1_0_1_52"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_252.html?cp=5_0_1_0_1_52&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_237.html?cp=5_0_1_0_1_44"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev3/ERR/nRF52840/Rev3/latest/anomaly_840_237.html?cp=5_0_1_0_1_44&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Try to disable the calibration and see if that changes the behavior that you see. If there is no changes then its likely not the Errata that is the issue.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/453627?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2023 08:24:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fc69531c-3242-4983-9326-d26411061dca</guid><dc:creator>kkuma256</dc:creator><description>&lt;p&gt;It appears that the reason the analog input values become incorrect is because AIN1 has 3.3V applied to it immediately upon startup.&lt;/p&gt;
&lt;p&gt;When there is no external circuit connected, AIN1 doesn&amp;#39;t exhibit such behavior, and the values are as expected.&lt;/p&gt;
&lt;p&gt;However, with an external circuit connected, AIN1 receives 3.3V, and the values are not as expected.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not very knowledgeable about hardware, so I&amp;#39;m not sure whether the cause is a software configuration issue or a hardware problem.&lt;/p&gt;
&lt;p&gt;Is it possible for such a phenomenon to occur due to software settings?&lt;/p&gt;
&lt;p&gt;The peripheral circuits include:&lt;/p&gt;
&lt;p&gt;SPI using P0.20, P0.08,P0.05, P0.16&lt;br /&gt;GPIO using P0.17, P0.18, P0.14, P0.11, P0.15&lt;br /&gt;AIN1 and AIN2 using P0.03 and P0.04.&lt;/p&gt;
&lt;p&gt;Additionally, at the beginning of the main function:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);
err_code = nrf_drv_gpiote_out_init(3, &amp;amp;out_config);
nrf_drv_gpiote_out_clear(3);
nrf_drv_gpiote_out_set(3);
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I forcefully configured P0.3 as a digital output (DO). In a scenario where there are no peripheral circuits connected, it worked correctly, transitioning from 0V to 3.3V. However, when peripheral circuits were connected, even after clearing, it did not transition to 0V.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/453330?ContentTypeID=1</link><pubDate>Tue, 31 Oct 2023 15:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30943582-18d5-436c-b0a4-c7f4f98b5d28</guid><dc:creator>kkuma256</dc:creator><description>&lt;p&gt;&lt;span&gt;I&amp;#39;m sorry. When I tried it again here, the numbers turned out as expected, so I&amp;#39;m not sure what the cause was. If it happens again, please let me know at that time.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: The results of nRF52840 ADC conversion are not as expected</title><link>https://devzone.nordicsemi.com/thread/453104?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2023 15:22:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:368eef52-a676-4328-bd07-4edede7cee65</guid><dc:creator>Bendik Heiskel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Apologies for the delay.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not able to replicate the issue you are seeing, using the saadc sample in nRF5 SDK 17.1.0&amp;nbsp; with the modified saadc resolution.&lt;/p&gt;
&lt;p&gt;Have you made any other modifications to the sample?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Bendik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>