<?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>SAADC - Calibration</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34785/saadc---calibration</link><description>nrf52832. 
 SDK14.2 
 Segger ES V3.34a 
 
 I am using nrf_drv_saadc_calibrate_offset() and find the next sample immediately after the calibration is erroneous. 
 
 There is an errata for this [86]. This suggests the following... 
 
 Workaround 
 Calibration</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Jun 2018 16:37:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34785/saadc---calibration" /><item><title>RE: SAADC - Calibration</title><link>https://devzone.nordicsemi.com/thread/135630?ContentTypeID=1</link><pubDate>Mon, 11 Jun 2018 16:37:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40998f37-d297-4294-8662-9627852ad9b8</guid><dc:creator>pabigot</dc:creator><description>&lt;p&gt;I have not encountered this specifically, but I have observed that SAADC calibration results in multiple DONE events, including one final DONE event that occurs after CALIBRATEDONE has been asserted. The interval between CALIBRATEDONE and the extra DONE is TACQ + 1.252 us, which is the interval between DONE events during calibration.&lt;/p&gt;
&lt;p&gt;If STOP is issued less than 4 us after CALIBRATEDONE the additional DONE event is not generated.&lt;/p&gt;
&lt;p&gt;My hypothesis is this extra DONE event is the underlying cause of PAN 86.&amp;nbsp; Perhaps the workaround is being initiated too late sometimes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC - Calibration</title><link>https://devzone.nordicsemi.com/thread/134468?ContentTypeID=1</link><pubDate>Mon, 04 Jun 2018 07:42:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5559a405-932f-4ba0-994e-815c325f1c08</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Paul,&lt;/p&gt;
&lt;p&gt;No. I have not. I don&amp;#39;t see the error when trying to calibrate at all. Probably because the error only occurs in some corner cases, and I think that the ACQTIME is particularly relevant.&lt;/p&gt;
&lt;p&gt;But I have not been able to set up a mix of settings that triggers the issue. If you could send a project where the issue is replicated, then I can look into it. It will go much faster than if I have to create this myself. I am sorry for the inconvenience.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC - Calibration</title><link>https://devzone.nordicsemi.com/thread/134399?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 14:57:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3990d48-6fde-4352-a3cd-9c3144b2a0cb</guid><dc:creator>while(1)</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for trying the workaround.&amp;nbsp; Does this mean you have seen the first sample error after calibration without the work around and then repeated the test with the work around, resulting in no error ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Paul&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC - Calibration</title><link>https://devzone.nordicsemi.com/thread/134393?ContentTypeID=1</link><pubDate>Fri, 01 Jun 2018 14:06:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f74f703c-0276-4f99-9b13-d8df4abf42b9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have tried to run calibration in the saadc example in SDK14.2, but I can&amp;#39;t see the same behavior as you. Would it be possible to send the project, or if you can&amp;#39;t, maybe a strip down version that is still replicating the issue?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC - Calibration</title><link>https://devzone.nordicsemi.com/thread/134125?ContentTypeID=1</link><pubDate>Thu, 31 May 2018 07:36:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50e3d6f7-c395-4cef-82ed-0f1404bfc755</guid><dc:creator>while(1)</dc:creator><description>&lt;p&gt;I can set the frequency for calibration with an event timer...&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;//Evaluate if offset calibration should be performed. Configure the SAADC_CALIBRATION_INTERVAL constant to change the calibration frequency&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; if((m_adc_evt_counter % SAADC_CALIBRATION_INTERVAL) == 0 &amp;amp;&amp;amp; p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE )&lt;br /&gt; { &lt;br /&gt; nrf_drv_saadc_abort(); // Abort all ongoing conversions. Calibration cannot be run if SAADC is busy&lt;br /&gt; //while(NRF_SAADC-&amp;gt;STATUS == (SAADC_STATUS_STATUS_Busy &amp;lt;&amp;lt; SAADC_STATUS_STATUS_Pos))&lt;br /&gt; &lt;br /&gt; m_saadc_calibrate = true; // Set flag to trigger calibration in main context when SAADC is stopped&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In main()...&lt;/p&gt;
&lt;p&gt;if(m_saadc_calibrate == true)&lt;br /&gt; {&lt;br /&gt; //Workaround&lt;br /&gt; //Calibration should follow the pattern STOP -&amp;gt; STOPPED -&amp;gt; CALIBRATEOFFSET -&amp;gt; CALIBRATEDONE -&amp;gt; STOP -&amp;gt; STOPPED -&amp;gt; START.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; NRF_LOG_INFO(&amp;quot;SAADC calibration starting... \r\n&amp;quot;);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; m_saadc_calibrate = false;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; while(nrf_drv_saadc_calibrate_offset() != NRF_SUCCESS); //Trigger calibration task&lt;/p&gt;
&lt;p&gt;nrf_saadc_disable();&lt;br /&gt; while(NRF_SAADC-&amp;gt;STATUS == (SAADC_STATUS_STATUS_Busy &amp;lt;&amp;lt; SAADC_STATUS_STATUS_Pos))&lt;br /&gt; {}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; nrf_saadc_enable();&lt;br /&gt; while(NRF_SAADC-&amp;gt;STATUS == (SAADC_STATUS_STATUS_Busy &amp;lt;&amp;lt; SAADC_STATUS_STATUS_Pos))&lt;br /&gt; {}&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; &lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It does improve but it doesn&amp;#39;t eliminate the problem.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These are the readings from Channel 1 ADC with input tied to VDD.&amp;nbsp; I take five readings so that it can be averaged, but the first reading is -140 (in this case).&amp;nbsp; This does not happen unless we calibrate.&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Calibration Done: 41111&lt;br /&gt;&amp;lt;info&amp;gt; app: Actual Seconds powered up: 161678&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;info&amp;gt; app: Actual Seconds powered up: 161679&lt;br /&gt;&amp;lt;info&amp;gt; app: Actual Seconds powered up: 161680&lt;br /&gt;&amp;lt;info&amp;gt; app: Actual temperature: 23&lt;br /&gt;&amp;lt;info&amp;gt; app: ADC event number: 41111&lt;br /&gt;&amp;lt;info&amp;gt; app: Channel -1 value: -140&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Channel -1 value: 11387&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Channel -1 value: 13027&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Channel -1 value: 13018&lt;/p&gt;
&lt;p&gt;&amp;lt;info&amp;gt; app: Channel -1 value: 13028&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My ADC settings for channel 1&lt;/p&gt;
&lt;p&gt;//set configuration for saadc channel 1&lt;br /&gt; channel_1_config.resistor_p = NRF_SAADC_RESISTOR_DISABLED;&lt;br /&gt; channel_1_config.resistor_n = NRF_SAADC_RESISTOR_DISABLED;&lt;br /&gt; channel_1_config.gain = NRF_SAADC_GAIN1_6;&lt;br /&gt; channel_1_config.reference = NRF_SAADC_REFERENCE_INTERNAL;&lt;br /&gt; channel_1_config.acq_time = NRF_SAADC_ACQTIME_40US;&lt;br /&gt; channel_1_config.mode = NRF_SAADC_MODE_SINGLE_ENDED;&lt;br /&gt; channel_1_config.pin_p = (nrf_saadc_input_t)(NRF_SAADC_INPUT_AIN1);&lt;br /&gt; channel_1_config.pin_n = NRF_SAADC_INPUT_DISABLED;&lt;/p&gt;
&lt;p&gt;saadc_config.resolution = NRF_SAADC_RESOLUTION_14BIT; //Set SAADC resolution to 12-bit. This will make the SAADC output values from 0 (when input voltage is 0V) to 2^12=2048 (when input voltage is 3.6V for channel gain setting of 1/6).&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; saadc_config.oversample = NRF_SAADC_OVERSAMPLE_8X; //Set oversample to 8x. This will make the SAADC output a single averaged value when the SAMPLE task is triggered&amp;nbsp;8 times.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC - Calibration</title><link>https://devzone.nordicsemi.com/thread/133835?ContentTypeID=1</link><pubDate>Tue, 29 May 2018 13:20:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37743fa2-cead-41e6-b4b8-4db0f105935d</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have never personally tested this workaround before. Could&amp;nbsp;you please upload the project where you do&amp;nbsp;the calibration, so that I can test it?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>