<?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 + BLE problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/54050/adc-ble-problem</link><description>Hello! Something strange is happening with my nrf51822. 
 I have a simple code to obtain data from the ADC and send it through BLE. 
 I do the following in the main loop: 
 1) capture adc data: 
 * Activate electronics (sensors) 
 nrf_gpio_pin_set (7</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 08 Nov 2019 06:55:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/54050/adc-ble-problem" /><item><title>RE: ADC + BLE problem</title><link>https://devzone.nordicsemi.com/thread/219202?ContentTypeID=1</link><pubDate>Fri, 08 Nov 2019 06:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4b08307b-ca24-44cd-80e8-e90de473a096</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have a scope available so you can check the state of the analog pin when you do the sampling?&lt;/p&gt;
&lt;p&gt;Otherwise it is hard to know if the problem is external to the chip, or if it is a software issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC + BLE problem</title><link>https://devzone.nordicsemi.com/thread/219001?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 09:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4765377d-57ea-4595-8855-8fb5a47fbd07</guid><dc:creator>Nasib</dc:creator><description>&lt;p&gt;i discover that the first reading of the ADC gives me wrong data... so i have to do at least a couple of readings before to enter in the while(1). Do you know why this could be happening?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC + BLE problem</title><link>https://devzone.nordicsemi.com/thread/218972?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2019 08:14:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0860aac4-756f-4b01-861a-27afdfc45310</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried running the application in debugger mode to try to figure out why the example is disconnecting?&lt;/p&gt;
&lt;p&gt;It is possible that some kind of assert or error occurs in the code, which might give you some idea regarding the cause of the issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;This send some data:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;nrf_gpio_pin_set(7); &lt;br /&gt;read_ADC(lectura);&amp;nbsp;&lt;/p&gt;
&lt;p&gt;while(1){&lt;br /&gt;send_data(lectura[0],lectura[1],lectura[2]);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;but THIS SEND TOTALLY DIFFERENT DATA!!!&lt;br /&gt;&lt;br /&gt;&lt;span&gt;nrf_gpio_pin_set(7);&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;while(1){&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;read_ADC&lt;/span&gt;&lt;span&gt;(lectura);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;send_data&lt;/span&gt;&lt;span&gt;(lectura[0],lectura[1],lectura[2]);&lt;/span&gt;&lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Isn&amp;#39;t it natural that you get different data if you read the ADC for every iteration of the loop?&lt;/p&gt;
&lt;p&gt;Or do you mean the data is drastically different in the range of values that you get?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>