<?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 Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15454/adc-result-not-changing-w-respect-to-analog-input</link><description>Hello, 
 I am trying to read data from nRF51422 ADC using SDK51 PCA10028 board downloaded with S130. I tried one of existing ADC with Softdevice examples, it seems to work for the most part but the data I am getting is always the same ( 0xA5). 
 The</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Aug 2016 12:24:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15454/adc-result-not-changing-w-respect-to-analog-input" /><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59015?ContentTypeID=1</link><pubDate>Tue, 16 Aug 2016 12:24:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c226958-e2cb-4a0e-9e24-8f88aae4628e</guid><dc:creator>Jay S.</dc:creator><description>&lt;p&gt;Thanks stefan, the problem was and the port labeling on the SDK51 board. For example, the analog input labeled P0.04 on the board corresponds to ADC_CONFIG_PSEL_AnalogInput5 (0x20).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59014?ContentTypeID=1</link><pubDate>Fri, 12 Aug 2016 10:41:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3559f4e-9520-44dc-af75-37f7d2cc98f9</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Jay&lt;/p&gt;
&lt;p&gt;Since the example I provided does not work, I see no other conclusion than that the ADC on your nRF51-DK is damaged. I would recommend to get another nRF51-DK.&lt;/p&gt;
&lt;p&gt;To further verify that the ADC is damaged, you can try out the &lt;a href="https://github.com/NordicSemiconductor/nrf51-ADC-examples"&gt;adc_timer_driven_scan_mode example available on Github&lt;/a&gt;, which samples on three ADC input pins, and does not use softdevice. Sorry for the lack of documentation on the Github examples, I need to work on that. However, this example should be simple, but if you have questions about it, just ask them directly here&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59013?ContentTypeID=1</link><pubDate>Wed, 10 Aug 2016 13:43:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef1421fa-31f9-4f8c-ad10-90dd4343addc</guid><dc:creator>Jay S.</dc:creator><description>&lt;p&gt;I tried the example above you recommended. The result does not change, it&amp;#39;s always 0. I also tried a few different thing such as:
1- changed the ADC input source to internal power supply, that gives correct reading.
2- did no. 1 with ADC ENABLE =0 and ADC ENABLE = 1, the result is still correct.
3. While ADC ENABLE = 1 I can still set an analog port as output and write to it.
Seems to me that ADC ENABLE is ineffective.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59020?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 18:14:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f1e99ae-7722-4fba-b7dd-06d7a3531b99</guid><dc:creator>Jay S.</dc:creator><description>&lt;p&gt;SDK: nRF5_SDK_11.0.0_89a8197 and SoftDevice: s130_nrf51_2.0.1&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59019?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 18:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd78ba72-cc69-4320-944e-4b9e985c69a0</guid><dc:creator>Jay S.</dc:creator><description>&lt;p&gt;I do get ADC interrupts checked it with breakpoint in the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59018?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 18:02:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e99fb34a-0c92-437e-9010-6155ad3b4a16</guid><dc:creator>Jay S.</dc:creator><description>&lt;p&gt;I check the result through debugger and also can see it as battery % in nRF HRM over Bluetooth connection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59017?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 17:39:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7043090d-e6ce-481b-b36e-f33a4700b4f6</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;How are you evaluating your results, via UART or via debugger? Are you surely getting ADC interrupts in ADC interrupt handler?&lt;/p&gt;
&lt;p&gt;What SDK version and softdevice version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59016?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 17:36:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:691e42a8-77de-4317-bf95-4fec244d7cd3</guid><dc:creator>Jay S.</dc:creator><description>&lt;p&gt;Hi SteFan&lt;/p&gt;
&lt;p&gt;I also had tried P0.01 and P0.02 before and results were incorrect aslo.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Result not changing w/respect to Analog input</title><link>https://devzone.nordicsemi.com/thread/59012?ContentTypeID=1</link><pubDate>Mon, 01 Aug 2016 17:04:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be56d78a-9a1c-4f2b-bf11-54676cc27567</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Jay&lt;/p&gt;
&lt;p&gt;Your ADC configuration seems to be fine, except that you are sampling on analog input pin 0 which maps to pin P0.26 on the nRF51 IC, which is shared with the input from the low frequency 32kHz crystal, see section 2.2.1 in the nRF51822 PS v3.2. Try to sample from e.g. analog input pin 2, which is pin P0.01 instead, to see if you get better results.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 5.8.2016&lt;/strong&gt;
Below is an example which is ble_app_hrs with nRF51 ADC addon, which hopefully addresses what you are trying to do. The example uses the nrf_drv_adc driver. ADC sampling is triggered from the battery application timer. The ADC driver allocates buffer and throws an event to the application when the buffer is full. The ADC handler takes an average value from the buffer values and also calculates millivolts and battery percentage before transferring the results over BLE.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_app_5F00_hrs_5F00_adc_5F00_battery_5F00_measurement.zip"&gt;ble_app_hrs_adc_battery_measurement.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>