<?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>nRF51822 ADC without UART</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5550/nrf51822-adc-without-uart</link><description>I am using the adc to sample a sensor and send this over the air.
For testing I used the simple_uart library and it works.
But now I don&amp;#39;t need the uart connection and I removed it from the project, but now the adc always returns 0. 
 I don&amp;#39;t need</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Mar 2016 08:21:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5550/nrf51822-adc-without-uart" /><item><title>RE: nRF51822 ADC without UART</title><link>https://devzone.nordicsemi.com/thread/19426?ContentTypeID=1</link><pubDate>Thu, 10 Mar 2016 08:21:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:125a9013-9400-4d60-b079-faa81d107a29</guid><dc:creator>jing</dc:creator><description>&lt;p&gt;I think the appropriate fix is to wait for the END event before reading the RESULT.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while (NRF_ADC-&amp;gt;EVENTS_END == 0)
{
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 ADC without UART</title><link>https://devzone.nordicsemi.com/thread/19425?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2015 14:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66b4e65d-b7ea-4eac-aef3-cd10efe26294</guid><dc:creator>Bombo</dc:creator><description>&lt;p&gt;I think I found it.
There needs to be a small delay between the start task and the check for busy.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint16_t ADC_Read(void)
{
NRF_ADC-&amp;gt;TASKS_START = 1;
__NOP(); // Delay to get the adc started
while(NRF_ADC-&amp;gt;BUSY == 1)
{
}
NRF_ADC-&amp;gt;TASKS_STOP = 1;
return NRF_ADC-&amp;gt;RESULT;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The UART did somehow delay the CPU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 ADC without UART</title><link>https://devzone.nordicsemi.com/thread/19424?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2015 13:30:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c611c71-04dd-49d9-a30e-61dada32be19</guid><dc:creator>Bombo</dc:creator><description>&lt;p&gt;I don&amp;#39;t send data over the UART, only over the air.
If I enable the UART it will be the first function in the main function.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF51822 ADC without UART</title><link>https://devzone.nordicsemi.com/thread/19423?ContentTypeID=1</link><pubDate>Thu, 12 Feb 2015 11:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12849ec7-1c8f-49af-afa8-e1ab9ba18410</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;Must be one of the simple coding mistakes such as:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Variable sent over the air modified in one of the UART functions.&lt;/li&gt;
&lt;li&gt;ADC restarted in UART function.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>