<?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 changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50161/saadc-changing-value-range-signed-to-unsigned</link><description>Hello Nordic Support, 
 I am using SAADC on nRF52840 with nRF5_SDK_15.3.0_59ac345 . 
 I use the following configurations: 
 
 The SAADC value, as I have been using is signed. I wonder if Nordic will later support unsigned value, or you will not? Or are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Jul 2019 12:50:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50161/saadc-changing-value-range-signed-to-unsigned" /><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200773?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 12:50:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:171cfb1e-1f96-41ac-9411-80244555b32e</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thanks for your clear answer. I am totally clear now.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Should check the datasheet more carefully.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200769?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 12:38:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:852029ff-7b0e-403e-8fe5-675f0cebf889</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The SAADC output is in the range [0, +2^(resolution)] in single ended mode. If resolution = 12, then the range is [0, 4096]&lt;/p&gt;
&lt;p&gt;If the SAADC samples VDD, then the output value is:&lt;/p&gt;
&lt;pre&gt;RESULT = (VDD) * (GAIN/VDD) * 2(RESOLUTION)&lt;br /&gt;&lt;br /&gt;RESULT = VDD * (GAIN/VDD) * 2^(12) = GAIN * 2^12&lt;br /&gt;&lt;br /&gt;If GAIN = 1, sampling VDD will output: &lt;span&gt;0b0001 0000 0000 0000 = 4096&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;The sample will then be stored with 2&amp;#39;s complement applied.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Negative values are due to ground bounce, if you experience this often, then consider to use differential mode instead.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;regards&lt;/div&gt;
&lt;div&gt;Jared&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200765?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 12:23:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b8898d8e-bfb0-47a9-ade6-d9ec58bc3f6f</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1564143649065v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Sometimes I still feel a little confusing when getting the result and reading the datasheet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200764?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 12:17:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea013b13-d234-4c22-857e-14b7f36a97c1</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/jared"&gt;Jared&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Oh I see that I didn&amp;#39;t read this part carefully:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1564143441079v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200750?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 11:41:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55fe7055-8367-4e8b-aebe-fb555d9e9ae4</guid><dc:creator>awneil</dc:creator><description>[quote userid="27129" url="~/f/nordic-q-a/50161/saadc-changing-value-range-signed-to-unsigned/200739"]But what is the truly input voltage when I got that small negative result[/quote]
&lt;p&gt;As the post you linked says, the negative results are likely due to slight ground differences, noise, etc.&lt;/p&gt;
&lt;p&gt;So the actual input voltage is less than the offset &amp;amp; noise!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200739?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 11:11:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78fcb9e4-3e39-423a-81e7-7a2a218cc8b7</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;Sorry for making the question note clear enough. Here is my calculation.&lt;/p&gt;
&lt;p&gt;For example I got:&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; + VDD = 2.4V&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; + Reference = VDD/4; Gain = 1/4&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; + Input range = (VDD/4)/(1/4) = 2.4V&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; + Single-ended ADC&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; + ADC resolution = 12 bit (-2048 to 2047?)&lt;/p&gt;
&lt;p&gt;So if my ADC is around 0 to 2.4V, the ADC I got will be&amp;nbsp;from 0 to 2047, is it right?&lt;/p&gt;
&lt;p&gt;And when the input is 2.4V, the ADC value (I get after calling the&amp;nbsp;&lt;span&gt;convert buffer&lt;/span&gt; function) will be = 1111 1000 0000 0000b.&lt;/p&gt;
&lt;p&gt;Is this right?&lt;/p&gt;
&lt;p&gt;And sometimes I get the result (after calling the convert buffer function): -7, -8, -4...to -1. What is the reason for this result? As I read from&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/46080/incorrect-adc-values-received/181581#181581"&gt;this post&lt;/a&gt;, this is the offset. But what is the truly input voltage when I got that small negative result?&lt;/p&gt;
&lt;p&gt;Thank you and best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Duy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200697?ContentTypeID=1</link><pubDate>Fri, 26 Jul 2019 09:03:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad29baba-4a7e-4f0e-b331-8a2751a78f1d</guid><dc:creator>Jared</dc:creator><description>[quote user="DuyLionTran"]In my case, I can only use 11 bits if the output of my device is 0V -&amp;gt; 1.9V. Is it right?&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;I&amp;#39;m not sure I understand you correctly, the result is stored as an 16 bit int. The number of bits you use is dependent on the chosen resolution. All bits will be set to 1&amp;#39;s when you&amp;#39;ve reached the reference/gain. The reference/gain value should be set to the maximum voltage that you would want to measure.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200590?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2019 15:36:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8e0dcc0-802d-4b09-a56d-f929e0777775</guid><dc:creator>Duy</dc:creator><description>&lt;p&gt;Hello &lt;a href="https://devzone.nordicsemi.com/members/jared"&gt;Jared&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;Thank you for your reply. It is because I am communicating with a device whose output is 0V to 1.9V and I want to use all 12 bits of the SAADC. In my case, I can only use 11 bits if the output of my device is 0V -&amp;gt; 1.9V. Is it right?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Duy&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SAADC changing value range (signed to unsigned)</title><link>https://devzone.nordicsemi.com/thread/200432?ContentTypeID=1</link><pubDate>Thu, 25 Jul 2019 08:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67697395-958b-45a0-ad47-1ee872852d97</guid><dc:creator>Jared</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The SAADC stores samples as 16 bits 2&amp;#39;s complement, I don&amp;#39;t know of any future plans to implement unsigned SAADC atm. Why would you need to store the samples as unsigned SAADC? The SAADC can be used in &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html?cp=3_1_0_36_1#saadc_overview"&gt;differential mode&lt;/a&gt; if you want to sample something not relative to local ground.&lt;/p&gt;
&lt;p&gt;regards&lt;/p&gt;
&lt;p&gt;Jared&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>