<?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 error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41396/adc-error</link><description>Hi, 
 I am experiencing an error of up to 8% on SAADC readings on the NRF52832. We have performed a sweep of the full range of the ADC and produced the following graph which shows the phenomenon: 
 
 The SAADC is set up in single ended mode using the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Dec 2018 20:11:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41396/adc-error" /><item><title>RE: ADC error</title><link>https://devzone.nordicsemi.com/thread/161541?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 20:11:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d96a6326-527a-40ab-987f-1147f81d36c8</guid><dc:creator>robertco</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;H&amp;aring;kon,&lt;/p&gt;
&lt;p&gt;Thanks for the further info. I&amp;#39;ll adjust the calibration interval to be longer. We don&amp;#39;t have temperature sensing on the device, so I can&amp;#39;t use that to trigger calibration.&lt;/p&gt;
&lt;p&gt;We&amp;#39;ve since repeated our testing and it seems that our initial tests after implementing the calibration were incorrect. Now, with calibration enabled it looks like we are getting within the 3% error margins you stated above.&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;Kind Regards,&lt;/p&gt;
&lt;p&gt;Rob&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC error</title><link>https://devzone.nordicsemi.com/thread/161357?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 08:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9316e5e-c19a-42a8-9287-dc10cc981c49</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Rob,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="robertco"]I am running the ADC calibration once every 5 seconds. What is the recommended frequency for running this task?[/quote]
&lt;p&gt;&amp;nbsp;That interval can be adjusted even higher (depending on how often the temperature changes in your environment).&amp;nbsp;You normally want to calibrate once on boot, then if something changes (temperature or any other environmental variable).&lt;/p&gt;
[quote user="robertco"]the readings are still not what I would expect to see. For example, at an input of 3.3v the ADC count is around 985 (where it should be around 1023).[/quote]
&lt;p&gt;Your results show that this get&amp;#39;s worse on higher voltage, it implies that this is due to gain error. You will have some gain error (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=2_1_0_36_11_0#unique_1874651084"&gt;up to +/- 3%&lt;/a&gt;), and smaller ripples (radio powering up, CPU waking up etc) in the power supply may also have an impact on the reference.&lt;/p&gt;
&lt;p&gt;Have you tried using the internal 0.6V reference (set in REFSEL register) to see if this improves the scenario? Remember to adjust the gain to match the maximum input voltage as well.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC error</title><link>https://devzone.nordicsemi.com/thread/161098?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 01:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e545dbc6-4bd4-461c-8a37-1442cab23cff</guid><dc:creator>robertco</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;span&gt;H&amp;aring;kon,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for your reply. I&amp;#39;ve now implemented points 1 and 2 of your suggestions and they have had minimal effect. I also found some redundant initialisation code which was re-initialising&amp;nbsp;the channel incorrectly, removing this has had more of an effect, but the readings are still not what I would expect to see. For example, at an input of 3.3v the ADC count is around 985 (where it should be around 1023).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I am running the ADC calibration once every 5 seconds. What is the recommended frequency for running this task?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With regard to point three, we have measured our supply voltage at 3.295V which would not account for the magnitude of the error we are seeing.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you have any further ideas?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Rob&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC error</title><link>https://devzone.nordicsemi.com/thread/160996?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 13:17:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dfbbf49-b278-4fa5-8eec-7afd9d677649</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q1: Is the external HFCLK running when doing the SAADC conversion? This is important, as the SAADC will inherit the tolerance from the clock source.&lt;/p&gt;
&lt;p&gt;You can start the HFCLK like this (prior to initializing the softdevice):&lt;/p&gt;
&lt;p&gt;NRF_CLOCK-&amp;gt;TASKS_HFCLKSTART = 1;&lt;/p&gt;
&lt;p&gt;while (NRF_CLOCK-&amp;gt;EVENTS_HFCLKSTARTED == 0);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q2: Have you calibrated the offset via &amp;quot;&lt;span&gt;TASKS_CALIBRATEOFFSET&amp;quot; ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Q3: Since you are using VDD/4 as the reference; are you 100 % certain that the input voltage is what you think it is? There&amp;#39;s usually a bit of a difference between setting 3.3V on a power source, and the measured voltage at the input of the nRF.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Håkon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>