<?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 read is not completeing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8670/adc-read-is-not-completeing</link><description>I&amp;#39;m working with an nrf51822 with the s110 softdevice. So I&amp;#39;m trying to read an analog signal from multiple pins. My program will run fine for quite some time. Eventually though for some reason the program gets caught up in the while loop of my get_adc</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Aug 2015 09:55:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8670/adc-read-is-not-completeing" /><item><title>RE: ADC read is not completeing</title><link>https://devzone.nordicsemi.com/thread/31769?ContentTypeID=1</link><pubDate>Wed, 12 Aug 2015 09:55:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9b12980-76b7-41cd-af2c-1a7a87ef071c</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;I am not exactly sure why your first solution did not work. Perhaps it is better to clear the event (NRF_ADC-&amp;gt;EVENTS_END = 0;) just before starting the sampling but after configuring the adc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC read is not completeing</title><link>https://devzone.nordicsemi.com/thread/31768?ContentTypeID=1</link><pubDate>Tue, 11 Aug 2015 17:49:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3553ab36-067c-4d9b-a6e1-7d4f7f800092</guid><dc:creator>nsnyder</dc:creator><description>&lt;p&gt;So I just ended up modifying the condition for the while loop. So now it not only looks to see if the adc has ended but also if the adc is busy. That took care of this problem.The code is below.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// wait for conversion to end
while (!NRF_ADC-&amp;gt;EVENTS_END &amp;amp;&amp;amp; NRF_ADC-&amp;gt;BUSY){};
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>