<?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>How calibration SAADC Negative Value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60287/how-calibration-saadc-negative-value</link><description>hello Dev Zone. 
 i need help. 
 
 now i&amp;#39;m try to make IR Line-tracer and detector 
 how ever, when my detecting object far then range, 
 &amp;quot;saadc&amp;quot; value change to Negative 
 I asume that it will goto 0, but change to &amp;quot;-&amp;quot; Velue please check my code and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Apr 2020 23:01:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60287/how-calibration-saadc-negative-value" /><item><title>RE: How calibration SAADC Negative Value</title><link>https://devzone.nordicsemi.com/thread/245674?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 23:01:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f63d063-91d1-4f4b-a17f-38a282b9106c</guid><dc:creator>Empe</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;span&gt;H&amp;aring;kon&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i&amp;#39;m try to sampling IR Receive value,&lt;/p&gt;
&lt;p&gt;minimum 130mv to max 3.05V&lt;/p&gt;
&lt;p&gt;so i was changed the setting Gain 1/4, Ref VDD/4, 14Bit resolution.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="2115" url="~/f/nordic-q-a/60287/how-calibration-saadc-negative-value/245563"]What value are you sampling? It is to be expected that you can get a negative number from the SAADC.[/quote]
&lt;p&gt;yes,&amp;nbsp;I modified it according to your advice, my saadc looks like more stable,&lt;/p&gt;
&lt;p&gt;but as you say still negative input value is looking.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Empe.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How calibration SAADC Negative Value</title><link>https://devzone.nordicsemi.com/thread/245563?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 13:25:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ea76cf8-938a-49d0-b4e7-22c0594d85d3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi Empe,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user="Empe"][/quote]&lt;/p&gt;
&lt;p&gt;by the way,&amp;nbsp;I am using all 7 SAADC, At this time&lt;/p&gt;
&lt;p&gt;The current method uses only CH [0] to sample one pin ADC per 1 START trigger.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It shouldn&amp;#39;t matter wrt. the result on a specific pin, if you time-mux the sampling, or if you let the SAADC sample each input for you. SAADC will do time-multiplexing when several inputs are selected.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What value are you sampling? It is to be expected that you can get a negative number from the SAADC.&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: How calibration SAADC Negative Value</title><link>https://devzone.nordicsemi.com/thread/245393?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 00:57:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:382805e0-c784-4bd5-be7a-8731f633f322</guid><dc:creator>Empe</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;span&gt;H&amp;aring;kon&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thanks for help.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I need to adjust the Gain and Resolution values well.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I also checked the contents of the link you wrote down.&lt;/p&gt;
&lt;p&gt;It helped a lot.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;by the way,&amp;nbsp;I am using all 7 SAADC, At this time&lt;/p&gt;
&lt;p&gt;The current method uses only CH [0] to sample one pin ADC per 1 START trigger.&lt;/p&gt;
&lt;p&gt;The time division method is being used.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Could this be a problem? Now i&amp;#39;m using &amp;quot;Case 1&amp;quot; Format&lt;/p&gt;
&lt;p&gt;do i need to change to &amp;quot;Case 2&amp;quot; Format?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Case 1
// Init Part
// Channel Value Change 1 to 7 
Init_SAADC
{
    ...
    ...
    NRF_SAADC-&amp;gt;CH[0].PSELP = ((unsigned long)channel) &amp;lt;&amp;lt; SAADC_CH_PSELP_PSELP_Pos;
    NRF_SAADC-&amp;gt;CH[0].PSELN = SAADC_CH_PSELN_PSELN_NC &amp;lt;&amp;lt; SAADC_CH_PSELN_PSELN_Pos;
    ...
    NRF_SAADC-&amp;gt;TASKS_START = 1;
    while (NRF_SAADC-&amp;gt;EVENTS_STARTED == 0);
    NRF_SAADC-&amp;gt;EVENTS_STARTED = 0;

    // Do a SAADC sample, will put the result in the configured RAM buffer.
    NRF_SAADC-&amp;gt;TASKS_SAMPLE = 1;
    while (NRF_SAADC-&amp;gt;EVENTS_END == 0);
    NRF_SAADC-&amp;gt;EVENTS_END = 0;

    return adcSample;
}


// Case 2
// Init Part
Init_SAADC
{
    ...
    ...
    NRF_SAADC-&amp;gt;CH[channel].PSELP = ((unsigned long)channel#1) &amp;lt;&amp;lt; SAADC_CH_PSELP_PSELP_Pos;
    NRF_SAADC-&amp;gt;CH[channel].PSELN = SAADC_CH_PSELN_PSELN_NC &amp;lt;&amp;lt; SAADC_CH_PSELN_PSELN_Pos;
    ...
    ...
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Empe.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How calibration SAADC Negative Value</title><link>https://devzone.nordicsemi.com/thread/245267?ContentTypeID=1</link><pubDate>Fri, 17 Apr 2020 14:15:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82bb528d-471d-4868-8c53-02a7de3ccead</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;The effective number of bits (ENOB) is less than 12, meaning that you will get noise; thus you can get negative values when sampling a grounded pin. Please see this thread for more info:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/12287/nrf52-saadc-noise/46443#46443"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/12287/nrf52-saadc-noise/46443#46443&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PS: Be sure to request the external HFCLK when using the SAADC, then release it after you are done with the conversion. The internal 64 MHz RC oscillator (HFINT) isn&amp;#39;t very accurate, thus you measurements might also suffer if you&amp;#39;re running using the HFINT&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></channel></rss>