<?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 value affects next values</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58638/saadc-value-affects-next-values</link><description>Hi, I&amp;#39;m developing custom board with nrf52832 
 The problem is that when saadc returns negative value, all values that saadc returns after are max possible values from config So the previous adc value affects all that goes after it. They stay at max until</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 Mar 2020 06:42:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58638/saadc-value-affects-next-values" /><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/241265?ContentTypeID=1</link><pubDate>Tue, 24 Mar 2020 06:42:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:914717d3-56cb-432b-9a8d-1e9ba3c32375</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Ok, I see that you have changed the project to use correct files and defines for nRF52832, it just looked a bit strange.&lt;/p&gt;
&lt;p&gt;In that case, I cannot see anything in particular in your code that should cause this behavior. Did you manage to measure the analog inputs to make sure these are at the expected levels?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/241242?ContentTypeID=1</link><pubDate>Mon, 23 Mar 2020 21:37:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:29a4c8a9-1f63-44b9-851c-e671d9b813d0</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;im using nrf52832, as I said this is test project where I changed 10056 pinouts&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/241203?ContentTypeID=1</link><pubDate>Mon, 23 Mar 2020 15:32:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dad4255-f795-46d4-b324-7bc478987100</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you using nRF52832, or nRF52840? From this ticket it looks like you use nRF52832, but in the GitHub repository, it seems like you have used pca10056 projects which are for nRF52840.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/239377?ContentTypeID=1</link><pubDate>Wed, 11 Mar 2020 15:04:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91731c9a-46c0-49ca-a116-db35b97c9c5a</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;&lt;a href="https://github.com/po1yb1ank/emg_hardware"&gt;https://github.com/po1yb1ank/emg_hardware&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sorry for complete mess in main.c, I&amp;#39;ve been testing a lot of things :)&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238448?ContentTypeID=1</link><pubDate>Fri, 06 Mar 2020 09:04:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b947053c-fd79-4132-8559-8e1b9feb685a</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I can&amp;#39;t think of anything in particular, but if you could post your code I can have a look at it to see if I can spot anything.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238406?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 20:56:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3ea80a14-c608-4b9d-85b3-429ae6fbcf7d</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;I&amp;#39;m going to check all the hardware a bit later. But first, is there any chance this bug is a software problem?&amp;nbsp;&lt;br /&gt;Anyway, thank you J&amp;oslash;rgen for answering my questions. I&amp;#39;m very glad that I can get help from specialist. Huge respect to Nordic tech support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238382?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 16:51:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6b68a7e-ca56-4943-9953-1ead5522401c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you able to scope the pin, to check that the input is what you expect? Do you have a nRF52 DK that you can reproduce this on, to rule out any board-related issues?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238354?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 15:26:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67a91ea2-2c82-4fb1-b23f-57b5f964c759</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;I can&amp;#39;t physically reconfigure connection to test with another pin right now. I use ain0(p0.02). The values you see are transferred over BLE, but they are the same as raw values as I can see in debug mode&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238339?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 14:44:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4990e317-9639-40e6-aecc-701f8c00281c</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;That is true, but from the image it looks like you input a much higher voltage than that. 3V input with 14-bit mode and 1/6 GAIN/internal reference should give samples of ~13-14000. Is this the raw values in the buffer, or have this been transferred over BLE? Have you checked the voltage level on the analog input with a scope etc., to see that there is nothing else pulling the voltage low? Which analog input do you use? Have you tested with another pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238322?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 14:04:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1d66d3f-39f8-4aac-910c-e012ab367512</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;I don&amp;#39;t get it. I said before that analog input receive&amp;nbsp;&lt;span style="font-family:inherit;"&gt;0.4-1.6V range. So there are no anything beyond VDD&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238233?ContentTypeID=1</link><pubDate>Thu, 05 Mar 2020 10:33:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa20214b-29a0-4e54-8de8-1dda22b25f76</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;This is why I asked about the supply voltage of the chip. The SAADC has an input range of 0-VDD. If the analog input goes beyond VDD, you will get undefined behavior and unexpected readings.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238139?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 19:31:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:721b63ea-ad62-4a71-a8e1-2f7a6bdeeb60</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/1040x240/__key/communityserver-discussions-components-files/4/wtf.png" /&gt;&lt;/p&gt;
&lt;p&gt;pic from ble. I changed resolution to 14 bit. As you can see the value is shifted. Also it looks like values hits top continuously before adc returns negative value (-17)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238135?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 19:15:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e2fb9ce-a103-4c57-ab5a-c46137172841</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;Of course. There are opamp that transform 4.3V on the battery into 0.4V. So ADC receive 0.4-1.6V range depends on battery charge level&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238094?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 15:26:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b379d602-e659-4a85-ad63-79aff88cb347</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The nRF52832 does not support 4.3V supply voltage, do you have a regulator in between the battery and the chip?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238087?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:59:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a47efd9-b03a-4caf-98bd-e7aac1dee03c</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;1.6V on adc (3.6V supply) discharged&lt;/p&gt;
&lt;p&gt;0.4V on adc (4.3V supply) full charged&lt;/p&gt;
&lt;p&gt;Internal and 1/6 gain&lt;/p&gt;
&lt;p&gt;Single-ended, as i mentioned before&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/238071?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 14:27:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32c2e8ba-f96c-4f74-aa0b-099d451248b1</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you using single-ended or differential mode?&lt;/p&gt;
&lt;p&gt;What reference and gain settings are you using?&lt;/p&gt;
&lt;p&gt;What is the supply voltage of the chip?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What is the voltage level on the analog input that you are sampling?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/237992?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 10:36:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f1c3298-8863-4bcc-a06c-f20e322ca2b7</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;The values are close to 12 bit max value (3800-4096).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Nvm, I just figured out what was wrong. The ble service value was unsigned int.&amp;nbsp; :D&lt;/p&gt;
&lt;p&gt;But I faced another issue with saadc. My values now are not in the middle of 12 bit range (2048&amp;plusmn;), but it feels like they are shifted to the top (3200&amp;plusmn;), how can I solve this problem?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/237985?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 10:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a9fe0dc-2ef9-48e4-949a-47b08d2e70cf</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I understand what you mean by &amp;quot;&lt;span&gt;&amp;nbsp;max possible values from config&amp;quot;. Can you give some examples of the values you are seeing? The samples from the SAADC are 16-bit signed integers.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: saadc value affects next values</title><link>https://devzone.nordicsemi.com/thread/237879?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 18:21:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:589ce5f4-e681-4860-a527-c80d36a9216f</guid><dc:creator>polyblank</dc:creator><description>&lt;p&gt;Quickfix:&lt;/p&gt;
&lt;p&gt;Board uses unipolar power supply, so there is no chance it can be wrong&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>