<?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>Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65881/multichannel-use-of-adc-in-nrf51822</link><description>I want to measure voltages at all 8 channels but when I am enabling all channels its sending the values once only and after that its not sending anything, my requirement is i don&amp;#39;t want to use any handler,i am using polling method simultaneously to sample</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 Sep 2020 12:05:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65881/multichannel-use-of-adc-in-nrf51822" /><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269644?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 12:05:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eefa462d-a927-4de6-81cb-0e74a1ff3d5b</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Akshay Khairkar"]Values i am getting 528 or 536 in printf statement as already told to you in the conversation.[/quote]
&lt;p&gt;Thank you for clarifying, this is hard for me to know when you are not being specific and saying things like &amp;quot;not getting any values&amp;quot;.&lt;br /&gt;&lt;br /&gt;I would not expect values in the 500 range when the pins are connected to either ground or VDD, I therefore suspect that these pins either is used for something else on the waveboard, or that you are connecting the wrong pins.&lt;br /&gt;&lt;br /&gt;Could you please share the datasheet and pinout of the waveboard device you are working with?&lt;br /&gt;Please also specify exactly which pins you are using on the board - do not say AIN0 and AIN1, unless they are marked as such on the board itself.&lt;/p&gt;
[quote user="Akshay Khairkar"]Yeah, in future i will do so I thought that was sufficient to be understandable.[/quote]
&lt;p&gt;Thank you, I appreciate it.&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue together,&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269600?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 09:53:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fabeef6a-13f5-4d1d-b9af-6642bc4b2832</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;Values i am getting 528 or 536 in printf statement as already told to you in the conversation.&lt;/p&gt;
&lt;p&gt;Yeah, in future i will do so I thought that was sufficient to be understandable.&lt;/p&gt;
&lt;p&gt;If i am making it volatile compiler giving me error which is as below&lt;/p&gt;
&lt;p&gt;error: passing argument 2 of &amp;#39;nrf_drv_adc_sample_convert&amp;#39; discards &amp;#39;volatile&amp;#39; qualifier from pointer target type [-Werror=discarded-qualifiers]&lt;br /&gt; 644 | nrf_drv_adc_sample_convert(&amp;amp;m_channel_config_0, &amp;amp;sample_channel_0);&lt;br /&gt; | ^~~~~~~~~~~~~~~~~&lt;br /&gt;In file included from main.c:68:&lt;br /&gt;components/drivers_nrf/adc/nrf_drv_adc.h:234:57: note: expected &amp;#39;nrf_adc_value_t *&amp;#39; {aka &amp;#39;short int *&amp;#39;} but argument is of type &amp;#39;volatile nrf_adc_value_t *&amp;#39; {aka &amp;#39;volatile short int *&amp;#39;}&lt;br /&gt; 234 | nrf_adc_value_t * p_value);&lt;br /&gt; | ~~~~~~~~~~~~~~~~~~^~~~~~~&lt;br /&gt;cc1: all warnings being treated as errors&lt;br /&gt;make: *** [components/toolchain/gcc/Makefile.common:135: _build/nrf51422_xxac_main.c.o] Error 1&lt;/p&gt;
&lt;p&gt;I am using visual studio for programming&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269582?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 09:02:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd0d769-9ebb-4025-96fc-df2b350a6261</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Akshay Khairkar"]i.e with or without input i am getting same values.[/quote]
&lt;p&gt;And what values are these? What is this program outputting? You need to tell me what is happening.&lt;br /&gt;You need to give me all the available information, so that I may best help you.&lt;br /&gt;&lt;br /&gt;I see from your code that you have changed the&amp;nbsp;&lt;em&gt;sample_channel_*&amp;nbsp;&lt;/em&gt;variable types from&amp;nbsp;&lt;em&gt;static&amp;nbsp;&lt;strong&gt;volatile&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;in the code I provided you earlier. Why have you done this?&lt;br /&gt;If they are not declared as volatile then the compiler will optimize them to a constant value of 0.&lt;br /&gt;&lt;br /&gt;By omitting such details, or making changes without telling me, &lt;em&gt;you are making it very hard to help you&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;In the future, please write out your problem description, symptoms and goals&amp;nbsp;&lt;em&gt;as clearly as possible&amp;nbsp;&lt;/em&gt;in order for others to be able to help you.&lt;br /&gt;This will reduce the time it takes for you &lt;em&gt;to receive help&lt;/em&gt;, and the time it takes&amp;nbsp;&lt;em&gt;to give this help&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;Please try to change the samples&amp;#39; type back to static volatile, and let me know what you observe when running the program.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269578?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 08:52:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c0a3ae9-56ee-48e7-a23a-443184cfbcb5</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;So here is my code for sampling 2 ADC channels and just printing the values of ADC, i just want ADC to give me values in printf statement according to the i/p like if i am giving&amp;nbsp; some voltages over this maybe between 1.0V to 3.3v so i should get the values according to voltage i.e.in between 0 - 1024 , but the values&amp;nbsp; i am getting are not changing i.e with or without input i am getting same values.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269575?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 08:46:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d61bac1d-cbb6-49cb-aa3a-26d17349005e</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static nrf_drv_adc_channel_t m_channel_config_0 = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_0);
static nrf_drv_adc_channel_t m_channel_config_1 = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_1);

static  nrf_adc_value_t sample_channel_0 = 0;
static  nrf_adc_value_t sample_channel_1 = 0;

static void adc_init(void)
{
    ret_code_t err_code;
    nrf_drv_adc_config_t config = NRF_DRV_ADC_DEFAULT_CONFIG;
    
    err_code = nrf_drv_adc_init(&amp;amp;config, NULL);
    APP_ERROR_CHECK(err_code);
}

//Error Code:H1600
void user_adc_init0(){
         nrf_drv_adc_sample_convert(&amp;amp;m_channel_config_0, &amp;amp;sample_channel_0);
  
         nrf_delay_ms(1000);

         printf(&amp;quot;\r\n  0 :%d\r\n&amp;quot;,sample_channel_0);
   
}
//Error Code:H1700
void user_adc_init1(){
   
   
      nrf_drv_adc_sample_convert(&amp;amp;m_channel_config_1, &amp;amp;sample_channel_1);
   
        printf(&amp;quot;\r\n  1 : %d\r\n&amp;quot;,sample_channel_1);
}
int main(void)
{

adc_init();
for (;;)
    {
      printf(&amp;quot;\r\n for Start!\r\n&amp;quot;);
      user_adc_init0();
      nrf_delay_ms(100);
      user_adc_init1();
      nrf_delay_ms(100);
      nrf_delay_ms(2000);
      printf(&amp;quot;\r\nADC fin!\r\n&amp;quot;);
      
      printf(&amp;quot;\r\n  0 :%d\r\n&amp;quot;,sample_channel_0);
      printf(&amp;quot;\r\n  1 : %d\r\n&amp;quot;,sample_channel_1);
      
     }
}

&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269568?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 08:29:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:333939a1-b7d0-4e1c-bda2-bef1190b08df</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Akshay Khairkar"]value i am getting after reading ADC, I just want ADC to give me some values according to my input to AN0 or AN1 pin still i am not getting any values[/quote]
&lt;p&gt;You are not giving me a lot to work with here, since you are not answering my questions.&lt;br /&gt;Please, take a look at what I asked about in my previous reply, and answer the questions I wrote you.&lt;br /&gt;I require more information in order to help you resolve this issue.&lt;/p&gt;
[quote user="Akshay Khairkar"]or tell me if it is hardware restriction[/quote]
&lt;p&gt;I assure you there are no hardware restrictions on reading multiple channels of the ADC. Do not worry, the&amp;nbsp;issue here is&amp;nbsp;not hardware restrictions.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269564?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 08:19:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:202c98f0-aca7-473f-bf31-3da1beab2053</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;Output (O/p) is nothing but value i am getting after reading ADC, I just want ADC to give me some values according to my input to AN0 or AN1 pin still i am not getting any values.Please suggest me if any other ways if available to read multichannel ADC values or tell me if it is hardware restriction&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269557?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 08:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1478bd70-053b-4651-a6ff-74e3cebc1924</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Please verify that you are using the correct pins on the Waveshare board. Could you share with me the pinout of the waveshare board you are using, and how you are testing it?&lt;/p&gt;
[quote user="Akshay Khairkar"]i am connecting to AN0 pin and AN1 pin[/quote]
&lt;p&gt;I assume you then have changed the code I provided earlier, to reflect this?&lt;br /&gt;Please share with me the code you are currently running.&lt;/p&gt;
[quote user="Akshay Khairkar"]10 bit ADC which can give o/p as 2^10 i.e. upto 1024 certainly with or without i/p its giving same value, there is no formula i am using right now i just want some o/p but its giving the o/p as mentioned above queries.[/quote]
&lt;p&gt;I do not know what you mean by &amp;quot;o/p&amp;quot;, but I agree that reading values in the 500 range using the 10-bit ADC configuration sounds strange.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269518?ContentTypeID=1</link><pubDate>Tue, 15 Sep 2020 06:44:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ba01c98-135b-428c-9202-42a30968ca61</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;I have BLE 400 Waveshare board i am connecting to AN0 pin and AN1 pin and giving 3.3v on that and also for checking connecting it to ground using 10 bit ADC which can give o/p as 2^10 i.e. upto 1024 certainly with or without i/p its giving same value, there is no formula i am using right now i just want some o/p but its giving the o/p as mentioned above queries. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269430?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 14:26:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c4e0f64-deb0-4686-859b-54773607aed6</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Which pins are you connecting your load to? Are you certain that you are connecting to the right pins? - A connection diagram would be a good way to verify this.&lt;br /&gt;How have you measured the voltage, so that you know it does not correspond to the ADC raw output 538?&lt;br /&gt;What formula are you using to convert the raw ADC outputs to voltage?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269414?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 14:02:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8246e184-bad0-4b0e-9bc4-535fc9732afc</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;This i have done already&amp;nbsp; also once again done after your post but still the values are not updating, constant values are coming like 538,507 with load without load&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269406?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 13:45:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:819fb518-767f-4480-8290-69075a26cae1</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;That was a typo on my end, sorry.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Fgroup__nrf__drv__adc.html&amp;amp;anchor=ga13ce7b2be107538728ed74c6f647903d"&gt;Here is the nrf_drv_adc_sample_convert API Reference documentation&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269397?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 13:33:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36a8ee7d-c11c-41eb-9bc8-e464d556848a</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;I think there some misunderstanding nrf_adv_convert_single i didn&amp;#39;t found any of reference in nrf SDK nrf_adc_convert_single if it is this then it takes only one argument i.e Analog i/p&lt;/p&gt;
&lt;div style="background-color:#1e1e1e;color:#d4d4d4;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;NRF_ADC_CONFIG_INPUT_1&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Please correct me i am missing some thing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269387?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 13:13:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:917fbe5f-6860-4778-bb40-16535cb12698</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Could you try to run the ADC example from the SDK that I referenced earlier, and see if you can get that up and running on your board?&lt;br /&gt;Please do, and try to understand what is being done in the examples code.&lt;br /&gt;&lt;br /&gt;In order to sample the 2 channels without using any timers or event handler, and with the default ADC and channel configuration,&amp;nbsp;what you would have to add to your application might look something like this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;nrf_drv_adc.h&amp;quot;

static const nrf_drv_adc_channel_t m_channel_config_1 = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_1);
static const nrf_drv_adc_channel_t m_channel_config_2 = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_2);

static volatile nrf_adc_value_t sample_channel_1 = 0;
static volatile nrf_adc_value_t sample_channel_2 = 0;

static void adc_init(void)
{
    ret_code_t err_code;
    nrf_drv_adv_config_t config = NRF_DRV_ADC_DEFAULT_CONFIG;
    
    err_code = nrf_drv_adc_init(&amp;amp;config, NULL)
    APP_ERROR_CHECK(err_code);
}
    
static void user_adc_sample_channel_1(void)
{
    nrf_drv_adc_sample_convert(&amp;amp;m_channel_config_1, &amp;amp;sample_channel_1);
}

static void user_adc_sample_channel_2(void)
{
    nrf_drv_adc_sample_convert(&amp;amp;m_channel_config_2, &amp;amp;sample_channel_2);
}

&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The result will be placed in the global sample variables.&lt;br /&gt;Hope this is what you were looking for.&lt;br /&gt;&lt;br /&gt;For future reference I highly recommend reading up on the API Reference for the driver you intend on using, to gain a better understanding of the functions and modules you are trying to use.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269374?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 12:42:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f117896b-84c5-4f44-a2fc-a54a5599ba6b</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;Sorry but I am not able to get can you please directly write the for sampling 2 channel ADC, as i not that good in programming this, can you please write the code for my above shown example code for sampling 2 channel ADC&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269368?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 12:25:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a63264a-3cad-47e7-8dd4-7146cc842fe2</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;I have now updated my previous reply to a working link, thank you for letting me know.&lt;br /&gt;The contents of the link is what I also pasted into my previous comment, namely that you still need to initialize the ADC.&lt;br /&gt;&lt;br /&gt;In the code you have shared you are only creating a default config structure, but you are not actually using it for anything.&lt;br /&gt;Please see the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v12.3.0/nrf_dev_adc_example.html"&gt;ADC Example&lt;/a&gt;&amp;nbsp;from the SDK, to see how you may go about initializing the ADC.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269361?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 11:54:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d60f8a30-012a-4ffb-8357-a0c9392e17c6</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;div style="background-color:#1e1e1e;color:#d4d4d4;font-family:&amp;#39;Droid Sans Mono&amp;#39;, &amp;#39;monospace&amp;#39;, monospace, &amp;#39;Droid Sans Fallback&amp;#39;;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#4ec9b0;"&gt;nrf_drv_adc_config_t&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; config = NRF_DRV_ADC_DEFAULT_CONFIG;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;void&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;user_adc_init0&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;printf&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;In ADC0&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; res=&lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nrf_adc_convert_single&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; ( NRF_ADC_CONFIG_INPUT_0) ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nrf_delay_ms&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;100&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;printf&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt; 0 :%ld&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;,res);&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#6a9955;"&gt;//Error Code:H1700&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#569cd6;"&gt;void&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;user_adc_init1&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(){&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; res=&lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nrf_adc_convert_single&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt; ( NRF_ADC_CONFIG_INPUT_1) ;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;nrf_delay_ms&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;100&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt; &lt;/span&gt;&lt;span style="color:#dcdcaa;"&gt;printf&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;(&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt; 1 : %ld&lt;/span&gt;&lt;span style="color:#d7ba7d;"&gt;\r\n&lt;/span&gt;&lt;span style="color:#ce9178;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;,res);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Sorry for the inconvenience caused earlier,can you please suggest me is there anything else required for initialization of ADC,as the Link you have provided is not working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269332?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 09:53:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7379913-a894-4329-9cc9-2a7009c3598c</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Please &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Fgroup__nrf__adc__hal.html&amp;amp;anchor=ga23c9071d2c15461db6bf6c8a144339b8"&gt;read the function documentation&lt;/a&gt;, it states:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;This function selects the desired input, starts a single conversion, waits for it to finish, and returns the result. After the input is selected, the analog-to-digital converter is left in STOP state. The function does not check if the ADC is initialized and powered.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You will still need to initialize and configure the ADC peripheral. From the provided code, it seems you do not do this.&lt;br /&gt;&lt;br /&gt;For future reference, please remove all commented out code if it serves no purpose for what you would like us to have a look at, it drastically decreases the readability of your code. If you are &amp;quot;keeping it for later&amp;quot;, then I would recommend making use of a separate file to store this code.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269328?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 09:41:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f25ca604-0fca-495b-9efe-c396057b7343</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void user_adc_init0(){
    printf(&amp;quot;\r\nIn ADC0\r\n&amp;quot;);
    //if(count==0)
   // {
    // static nrf_drv_adc_channel_t channel0 = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_0);
    // nrf_drv_adc_channel_enable(&amp;amp;channel0);
     //res=nrf_drv_adc_sample_convert(&amp;amp;channel0,&amp;amp;adc_val[0]);
     
     
     res=nrf_adc_convert_single 	( NRF_ADC_CONFIG_INPUT_1) 	;
     nrf_delay_ms(100);
     
     
    // NRF_ADC-&amp;gt;TASKS_STOP = 1;=
   //  nrf_drv_adc_channel_disable(&amp;amp;channel0);
    
    // NRF_ADC-&amp;gt;CONFIG &amp;amp;= (~ADC_CONFIG_PSEL_Msk);
     //nrf_adc_stop();

     count=1;
    //}
   
}
//Error Code:H1700
void user_adc_init1(){
   
    //if(count==1)
    //{
        //static nrf_drv_adc_channel_t channel1 = NRF_DRV_ADC_DEFAULT_CHANNEL(NRF_ADC_CONFIG_INPUT_1);
       // nrf_drv_adc_channel_enable(&amp;amp;channel1);
      //  nrf_drv_adc_sample_convert(&amp;amp;channel1,&amp;amp;adc_val[1]);
      
      
        res=nrf_adc_convert_single 	( NRF_ADC_CONFIG_INPUT_1) 	;
        nrf_delay_ms(100);
        
        
        //NRF_ADC-&amp;gt;CONFIG &amp;amp;= (~ADC_CONFIG_PSEL_Msk);
       // count=0;
       // nrf_adc_stop();

    /// }
    // nrf_drv_adc_channel_disable(&amp;amp;channel0);
}

int main(void)
{
    uint32_t err_code;
    bool erase_bonds;

    // Initialize.
    APP_TIMER_INIT(APP_TIMER_PRESCALER, APP_TIMER_OP_QUEUE_SIZE, false);
    uart_init();

    buttons_leds_init(&amp;amp;erase_bonds);
    ble_stack_init();
    gap_params_init();
    services_init();
    advertising_init();
    conn_params_init();

    printf(&amp;quot;\r\nUART Start!\r\n&amp;quot;);
    err_code = ble_advertising_start(BLE_ADV_MODE_FAST);
    APP_ERROR_CHECK(err_code);

    // Enter main loop.
    for (;;)
    {
      printf(&amp;quot;\r\n for Start!\r\n&amp;quot;);
      user_adc_init0();
      nrf_delay_ms(100);
      user_adc_init1();
      nrf_delay_ms(100);
      /*user_adc_init2();
      nrf_delay_ms(100);
      user_adc_init3();
      nrf_delay_ms(100);
      user_adc_init4();*/
      nrf_delay_ms(2000);
          printf(&amp;quot;\r\nADC fin!\r\n&amp;quot;);

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the code I am working on as per your instructions tried&amp;nbsp; &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Fgroup__nrf__adc__hal.html&amp;amp;anchor=ga23c9071d2c15461db6bf6c8a144339b8"&gt;nrf_adc_convert_single&lt;/a&gt; still result is coming 0,0 while giving signal also.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269299?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 07:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15396533-af2a-4758-9009-cca594446fe9</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;[quote user="Akshay Khairkar"][/quote]&lt;/p&gt;
&lt;p&gt;Yes will need to reconfigure every time.&lt;/p&gt;
&lt;p&gt;I will be modifying afterwards but right now I want to do this only.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Great, then we are on the same page on this. Using the driver might be easier for you, but then you will have to use an event handler. Please see the &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Fgroup__nrf__drv__adc.html&amp;amp;anchor=gadf8f5157651ccf64a60a1fd6584d08ea"&gt;nrf_drv_adv_sample function documentation&lt;/a&gt;.&lt;/p&gt;
[quote user="Akshay Khairkar"]I am using SDK12.3.0&amp;nbsp;[/quote]
&lt;p&gt;Then you will probably want to use the&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v12.3.0%2Fgroup__nrf__adc__hal.html&amp;amp;anchor=ga23c9071d2c15461db6bf6c8a144339b8"&gt;nrf_adc_convert_single&lt;/a&gt;&amp;nbsp;function directly.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269292?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 07:31:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aba8d917-fc1d-4cfc-8512-e9b11ba77fc5</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;Yes will need to reconfigure every time.&lt;/p&gt;
&lt;p&gt;I will be modifying afterwards but right now I want to do this only.&lt;/p&gt;
&lt;p&gt;I am using SDK12.3.0&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269286?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 07:14:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e853ce3-70a0-4d61-91f8-754b572e457e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="Akshay Khairkar"]Yes I want to sample all 8 channels, continuously without using&amp;nbsp; handler,I want to prefer sampleconvert() func because there is need afterwards, ii am not using any timer and don&amp;#39;t want use it. I just want to sample all ADC pins continuously.[/quote]
&lt;p&gt;This means that you will have to reconfigure for every channel, and call the sample function in a loop.&lt;br /&gt;Which SDK version are you using?&lt;br /&gt;&lt;br /&gt;I understand that you do not want to use a handler or a timer, but is there a particular reason for this? Your general application performance might be considerably worse if you do nothing to time or otherwise control when and how fast the samplings happen - but you are of course free to do so.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269283?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 07:04:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ae51308-5f27-4985-89a5-75ab09e372f6</guid><dc:creator>Akshay Khairkar</dc:creator><description>&lt;p&gt;Yes I want to sample all 8 channels, continuously without using&amp;nbsp; handler,I want to prefer sampleconvert() func because there is need afterwards, ii am not using any timer and don&amp;#39;t want use it. I just want to sample all ADC pins continuously.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multichannel use of ADC in NRF51822</title><link>https://devzone.nordicsemi.com/thread/269280?ContentTypeID=1</link><pubDate>Mon, 14 Sep 2020 06:51:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8d09a63-27c7-4539-8810-110f35da7b93</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;I am not sure that I understand your issue here - you would like to sample all 8 channels, but only once, and without using a handler?&lt;br /&gt;Could you elaborate exactly why you would not like to use a handler, what do you mean by this? - you would prefer to use the sample() function, called by the CPU manually?&lt;/p&gt;
[quote user=""]please suggest if any code available or any support message for the same.[/quote]
&lt;p&gt;Have you seen &lt;a href="https://github.com/NordicPlayground/nrf51-ADC-examples/tree/master/adc_timer_driven_scan_mode"&gt;the ADC&amp;nbsp;timer driven scan example on the NordicPlayground repository&lt;/a&gt;?&lt;br /&gt;It sounds like it might be demonstrate the functionality you are looking for.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>