<?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>Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21295/can-i-measure-battery-level-without-any-external-components-nrf51</link><description>I want to undestand this. I can&amp;#39;t see any examples with it. In the example ble_app_proximity I always received 100% level.
If it possible, can anybody give a ADC config example for it?
Thanks.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 18 Apr 2017 14:29:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21295/can-i-measure-battery-level-without-any-external-components-nrf51" /><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83430?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2017 14:29:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dec9c020-de2d-48b3-b7f3-207844fbf0e7</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;yes, it is works. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83420?ContentTypeID=1</link><pubDate>Tue, 18 Apr 2017 11:27:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7646c94f-ce7b-46f7-b323-df32e86692f7</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Looks like it should work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83429?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 12:35:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3eeef887-abed-4605-84f0-79e515738a7e</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Looks work.
code from here:
&lt;a href="https://developer.mbed.org/users/MarceloSalazar/notebook/measuring-battery-voltage-with-nordic-nrf51x/"&gt;developer.mbed.org/.../&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void my_analogin_init(void)
{
NRF_ADC-&amp;gt;ENABLE = ADC_ENABLE_ENABLE_Enabled;
NRF_ADC-&amp;gt;CONFIG = (ADC_CONFIG_RES_10bit &amp;lt;&amp;lt; ADC_CONFIG_RES_Pos) |
                  (ADC_CONFIG_INPSEL_SupplyOneThirdPrescaling &amp;lt;&amp;lt; ADC_CONFIG_INPSEL_Pos) |
                  (ADC_CONFIG_REFSEL_VBG &amp;lt;&amp;lt; ADC_CONFIG_REFSEL_Pos) |
                  (ADC_CONFIG_PSEL_Disabled &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos) |
                  (ADC_CONFIG_EXTREFSEL_None &amp;lt;&amp;lt; ADC_CONFIG_EXTREFSEL_Pos);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint16_t my_analogin_read_u16(void)
{
NRF_ADC-&amp;gt;CONFIG     &amp;amp;= ~ADC_CONFIG_PSEL_Msk;
NRF_ADC-&amp;gt;CONFIG     |= ADC_CONFIG_PSEL_Disabled &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos;
NRF_ADC-&amp;gt;TASKS_START = 1;
while (((NRF_ADC-&amp;gt;BUSY &amp;amp; ADC_BUSY_BUSY_Msk) &amp;gt;&amp;gt; ADC_BUSY_BUSY_Pos) == ADC_BUSY_BUSY_Busy) {};
return (uint16_t)NRF_ADC-&amp;gt;RESULT; // 10 bit
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;is it correct settings for ADC for my case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83423?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 10:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c020b7a0-b961-45c9-b3fa-fc692a2475bb</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;There was no ADC driver in SDK 9, this was first added in SDK 11. Only HAL driver is available. You need to add ADC driver from SDK 11 to SDK 9 (I think this should work without modifications), or migrate to at least SDK 11. You can also use the ADC HAL driver as shown in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v9.0.0/nrf_dev_adc_example.html?cp=4_0_5_4_6_2"&gt;ADC HAL example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83428?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 09:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0731ffa3-2746-4fa6-824e-a37357c69afd</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;I tryed this example. Doesn&amp;#39;t work on my SDK9. This example for SDK11. I mean than I can&amp;#39;t compile&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static nrf_drv_adc_channel_t adc_channel_config = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_2);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;there is no&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_adc_channel_t 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;struct in SDK9&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83421?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 08:35:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a105996b-afe0-421c-8cfa-bc9c348c5682</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;I watched this post. Thanks. Wich one of examples? I suppose
ble_app_hrs_adc_battery_measurement.
I try to do it. Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83422?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 08:20:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a1e8c4c-dd4b-4180-a045-1aaa6936cfbd</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/120549/battery-level-check/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83414?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 08:03:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f205075-6819-47df-92f9-560eb00f5367</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;I mean batt voltage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83418?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 08:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b70243be-acaf-43b7-8d82-7b96a02388b6</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;in my same example on SDK9 I have next code&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/**
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;@brief ADC initialization.
*/
void adc_config(void)
{
const nrf_adc_config_t nrf_adc_config = NRF_ADC_CONFIG_DEFAULT;&lt;/p&gt;
&lt;p&gt;// Initialize and configure ADC
nrf_adc_configure( (nrf_adc_config_t *)&amp;amp;nrf_adc_config);
nrf_adc_input_select(NRF_ADC_CONFIG_INPUT_2);
nrf_adc_int_enable(ADC_INTENSET_END_Enabled &amp;lt;&amp;lt; ADC_INTENSET_END_Pos);
NVIC_SetPriority(ADC_IRQn, NRF_APP_PRIORITY_HIGH);
NVIC_EnableIRQ(ADC_IRQn);
}&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As we see, it is no measure internal batt level by code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_adc_input_select(NRF_ADC_CONFIG_INPUT_2);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83427?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 07:16:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27fe817b-3564-46f6-830f-88bb08da6b0d</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;I readed all comments, but I can&amp;#39;t follow to link above. It doesn&amp;#39;t open. Relink pls.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83417?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 07:15:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14e4a15f-d3af-4c5d-947a-175d86ada4d7</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;I watched same example in SDK 9. But I can&amp;#39;t see config of ADC for internal battery measure.
Your link I can&amp;#39;t open. Relink pls.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83426?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 07:14:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d4440a6-a4ee-4865-9975-cb14272aa426</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Did you actually read all the comments - and follow the link?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83413?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 07:09:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43f9ad1b-2616-4f22-9203-7b4b350b9b6c</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;What do you mean by battery &amp;quot;&lt;em&gt;level&lt;/em&gt;&amp;quot; ?&lt;/p&gt;
&lt;p&gt;Note that battery &lt;strong&gt;voltage&lt;/strong&gt; may not give any useful indication of the remaining battery &lt;strong&gt;&lt;em&gt;life&lt;/em&gt;&lt;/strong&gt;!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83425?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 07:09:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fcdc9fd-06bf-4ece-80bb-c3b733e9ad1e</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;repeat what do You mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83424?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 07:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f567d82-22a3-4bdd-aec2-9907ac6349b1</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;And, in particular, note that comment that &lt;strong&gt;measuring the battery voltage may &lt;em&gt;not&lt;/em&gt; give any useful indication of the remaining battery life!&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83416?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2017 15:19:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:308f5f63-dfda-4456-add3-713d6bac1617</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;I see &lt;code&gt;nRF51_SDK_9.0.0_2e23562.zip\examples\peripheral\adc_simple\&lt;/code&gt; example, does it help?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83415?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2017 15:01:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdcd6875-7b81-43f7-9596-011edbcd8af1</guid><dc:creator>Mikhail</dc:creator><description>&lt;p&gt;Tnanks. But I still have question- how to init ADC in SDK9?
As I understand, I should setting in function&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_adc_input_select()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;transfer to it&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_ADC_CONFIG_SCALING_SUPPLY_ONE_THIRD
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;is it correct?&lt;/p&gt;
&lt;p&gt;function nrf_adc_input_select()&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;__STATIC_INLINE void nrf_adc_input_select(nrf_adc_config_input_t input)
{
NRF_ADC-&amp;gt;CONFIG =
    ((uint32_t)input &amp;lt;&amp;lt; ADC_CONFIG_PSEL_Pos) | (NRF_ADC-&amp;gt;CONFIG &amp;amp; ~ADC_CONFIG_PSEL_Msk);

if (input != NRF_ADC_CONFIG_INPUT_DISABLED)
{
    NRF_ADC-&amp;gt;ENABLE = ADC_ENABLE_ENABLE_Enabled &amp;lt;&amp;lt; ADC_ENABLE_ENABLE_Pos;
}
else
{
    NRF_ADC-&amp;gt;ENABLE = ADC_ENABLE_ENABLE_Disabled &amp;lt;&amp;lt; ADC_ENABLE_ENABLE_Pos;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can I measure battery level without any external components nrf51</title><link>https://devzone.nordicsemi.com/thread/83419?ContentTypeID=1</link><pubDate>Tue, 11 Apr 2017 14:38:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b9415db-4740-46e9-bd68-f552f7a10396</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/question/120549/battery-level-check/"&gt;Read this&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>