<?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>Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart</link><description>Hi all iam trying to read the differential analog voltage between AIN0 and AIN1 which is pin0.02 and pin0.03 and print the voltage which will be in micro volts from 400 micorvolt, and since the examples in sdk uses log_flush i could not get the data or</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 02 Dec 2021 09:15:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart" /><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341659?ContentTypeID=1</link><pubDate>Thu, 02 Dec 2021 09:15:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6153b30f-b398-49b3-866e-c9061c88bd50</guid><dc:creator>Nagaraj JP</dc:creator><description>[quote userid="91187" url="~/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart/341338#341338"]We do have documentation on&amp;nbsp;this here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Changing the&amp;nbsp;&lt;span&gt;macro to differential, se doc:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__saadc.html?cp=8_1_6_8_0_30_0_6#gace77828be7bbc7b1c350bc33c7a53a6e"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__saadc.html?cp=8_1_6_8_0_30_0_6#gace77828be7bbc7b1c350bc33c7a53a6e&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thankyou JONATHAN for the reference i will check it out and will come to this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341385?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 19:06:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88416f13-270d-4316-acfa-ea8df93cb910</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/jonathanll"&gt;JONATHAN LL&lt;/a&gt;Thank you for sharing the clarification on &lt;a title="nRF SDK5 v1.7.1" href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_sdk%2Fstruct%2Fsdk_nrf5_latest.html&amp;amp;cp=8_1"&gt;nRF SDK5&lt;/a&gt;.&amp;nbsp; Though I&amp;#39;m not using this SDK like Nagaraj it&amp;#39;s helpful to know about it.&amp;nbsp; Looks like this SDK represents the non-Zephyr SDK for a wide range of Nordic Semi devices.&lt;/p&gt;
&lt;p&gt;Thank you again for educating me.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341338?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 14:34:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bdd6e8a-8817-4911-998a-bea4083f180d</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;We do have documentation on&amp;nbsp;this here:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf52840/saadc.html?cp=4_0_0_5_22&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Changing the&amp;nbsp;&lt;span&gt;macro to differential, se doc:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__saadc.html?cp=8_1_6_8_0_30_0_6#gace77828be7bbc7b1c350bc33c7a53a6e"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__drv__saadc.html?cp=8_1_6_8_0_30_0_6#gace77828be7bbc7b1c350bc33c7a53a6e&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;As for pins, only the AINX pins can be used.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341242?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 10:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e60e621-06e7-4bf6-b3b1-41d9b33a6e30</guid><dc:creator>Nagaraj JP</dc:creator><description>&lt;p&gt;im using sdk version 17.1.0 can you help me out in differential adc which pins i should use for that differential adc and how to configure the sdk_config for differential adc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341240?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 10:33:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:835f0225-2d85-45f4-89df-7cd5d60f1f04</guid><dc:creator>Nagaraj JP</dc:creator><description>&lt;p&gt;thankyou Jonathan i can now set the resolution in &amp;quot;sdk_config.h&amp;quot;. now only the differential adc using nrf52840 any thoughts on that can you help me out in that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341185?ContentTypeID=1</link><pubDate>Tue, 30 Nov 2021 07:47:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40e19477-76c2-44d5-840e-9f94403bf44c</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;You should be able to change the resolution with the&amp;nbsp;&lt;span&gt;DEFAULT_SE macro.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341066?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 12:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fffd2f8e-ac09-4dbb-8f64-8efe59b344e8</guid><dc:creator>Nagaraj JP</dc:creator><description>[quote userid="91187" url="~/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart/341004#341004"]Your handler is empty, so&amp;nbsp;&lt;span&gt;nothing happens, the handler completes, and the program moves on.&lt;br /&gt;&lt;/span&gt;[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am getting the output in serial terminal by using &amp;quot;&amp;nbsp;NRF_LOG_FLUSH();&amp;quot; and i dont know how it works, now i want to change the resolution of the adc can you please help me out in that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/341004?ContentTypeID=1</link><pubDate>Mon, 29 Nov 2021 08:57:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23109b6e-b0ed-4c6a-9a6f-f1bc85810265</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Your handler is empty, so&amp;nbsp;&lt;span&gt;nothing happens, the handler completes, and the program moves on.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Look at the saadc example, in the handler there is the following:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;    if (p_event-&amp;gt;type == NRF_DRV_SAADC_EVT_DONE)
    {
        ret_code_t err_code;

        err_code = nrf_drv_saadc_buffer_convert(p_event-&amp;gt;data.done.p_buffer, SAMPLES_IN_BUFFER);
        APP_ERROR_CHECK(err_code);

        int i;
        NRF_LOG_INFO(&amp;quot;ADC event number: %d&amp;quot;, (int)m_adc_evt_counter);

        for (i = 0; i &amp;lt; SAMPLES_IN_BUFFER; i++)
        {
            NRF_LOG_INFO(&amp;quot;%d&amp;quot;, p_event-&amp;gt;data.done.p_buffer[i]);
        }
        m_adc_evt_counter++;
    }&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Use this to get the data.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340887?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 11:49:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e00ad8c4-7104-44f5-b366-f581aef58a4d</guid><dc:creator>Nagaraj JP</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;lt;stdbool.h&amp;gt;
#include &amp;lt;stdint.h&amp;gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;nrf_drv_saadc.h&amp;quot;
#include &amp;quot;nrf_drv_ppi.h&amp;quot;
#include &amp;quot;nrf_drv_timer.h&amp;quot;
#include &amp;quot;boards.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;app_util_platform.h&amp;quot;
#include &amp;quot;nrf_pwr_mgmt.h&amp;quot;

//#include &amp;quot;app_uart.h&amp;quot;
#include &amp;quot;app_error.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf.h&amp;quot;
#include &amp;quot;bsp.h&amp;quot;
#if defined (UART_PRESENT)
#include &amp;quot;nrf_uart.h&amp;quot;
#endif
#if defined (UARTE_PRESENT)
#include &amp;quot;nrf_uarte.h&amp;quot;
#endif


#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
#include &amp;quot;nrf_log_default_backends.h&amp;quot;

void saadc_callback_handler(nrf_drv_saadc_evt_t const * p_event)
{
 // Empty handler function
}
// Create a function which configures the adc input pins and channels as well as the mode of operation of adc

void saadc_init(void)
{
	// A variable to hold the error code
  ret_code_t err_code;

  // Create a config struct and assign it default values along with the Pin number for ADC Input
  // Configure the input as Single Ended(One Pin Reading)
  // Make sure you allocate the right pin.
  nrf_saadc_channel_config_t channel_config = NRFX_SAADC_DEFAULT_CHANNEL_CONFIG_SE(NRF_SAADC_INPUT_AIN2);

  // Initialize the saadc 
  // first parameter is for configuring the adc resolution and other features, we will see in future tutorial
  //on how to work with it. right now just pass a simple null value
  err_code = nrf_drv_saadc_init(NULL, saadc_callback_handler);
  APP_ERROR_CHECK(err_code);

// Initialize the Channel which will be connected to that specific pin.
  err_code = nrfx_saadc_channel_init(0, &amp;amp;channel_config);
  APP_ERROR_CHECK(err_code);

  

}


// A function which will initialize the Log module for us
void log_init(void)
{
	// check if any error occurred during its initialization
  APP_ERROR_CHECK(NRF_LOG_INIT(NULL));

	// Initialize the log backends module
  NRF_LOG_DEFAULT_BACKENDS_INIT();

}
 
int main(void)
{
     // call the log initialization function
  log_init();

// call the saadc initialization function created above
  saadc_init();

// a struct to hold 16-bit value, create a variable of this type because our input resolution may vary from 8 bit to 14 bits depending on our configurations
// this variable holds the adc sample value
  nrf_saadc_value_t adc_val;


// Print a simple msg that everything started without any error
  NRF_LOG_INFO(&amp;quot;Application Started!!!&amp;quot;);


    while (1)
    {
       // a blocking function which will be called and the processor waits until the value is read
		// the sample value read is in 2&amp;#39;s complement and is automatically converted once retrieved
		// first parameter is for the adc input channel 
		// second parameter is to pass the address of the variable in which we store our adc sample value
      nrfx_saadc_sample_convert(0, &amp;amp;adc_val);

		// print this value using nrf log : here %d represents the integer value 
      NRF_LOG_INFO(&amp;quot;Sample value Read: %d&amp;quot;, adc_val);
		
		// use nrf log and float marker to show the floating point values on the log
		// calculate the voltage by this: input_sample * 3.6 / 2^n (where n = 8 or 10 or 12 or 14 depending on our configuration for resolution in bits)
      NRF_LOG_INFO(&amp;quot;Volts: &amp;quot; NRF_LOG_FLOAT_MARKER &amp;quot;\r\n&amp;quot;, NRF_LOG_FLOAT(adc_val * 3.6 / 512));
       
	   // give 500ms delay 
       nrf_delay_ms(500);
        
    }
}


/** @} */
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The above is my code i could not print the voltage value on serial terminal, the above code is for single ended adc where do i miss i dont understand any idea please share with me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340848?ContentTypeID=1</link><pubDate>Fri, 26 Nov 2021 09:09:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f1705f7-bb23-4bc5-9d33-238bbfc871e2</guid><dc:creator>Nagaraj JP</dc:creator><description>[quote userid="91187" url="~/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart/340769#340769"]Check out the&amp;nbsp;adc &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/structnrfx__adc__done__evt__t.html?cp=8_1_6_8_0_1_0_1"&gt;Done event&lt;/a&gt;, you will be able to acess the data from the DONE event in the evnet handler&amp;nbsp;&lt;span&gt;saadc_evt_handler. Check out how it is done in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/nrf_dev_saadc_example.html?cp=8_1_4_6_35"&gt;SAADC example&lt;/a&gt;. The log_flush does not &amp;quot;flush&amp;quot; the data away or &lt;span style="font-size:12px;"&gt;discard&lt;/span&gt;&amp;nbsp;the data.&amp;nbsp;&lt;/span&gt;[/quote]
&lt;p&gt;Thankyou i will search for this can suggest me any code for differential voltage measurment.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340790?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 16:34:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e3226dd-afcd-4d35-b91a-0a75dc347381</guid><dc:creator>Nagaraj JP</dc:creator><description>&lt;p&gt;Thankyou for the effort you have put for me&amp;nbsp;&lt;/p&gt;
[quote userid="104297" url="~/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart/340652#340652"]Glad to hear you have made some progress in obtaining ADC readings, if so far just the raw readings.&amp;nbsp;[/quote]
&lt;p&gt;yes iam getting only the the raw data printed in the serial terminal but i could not access the data in the controller since these values are printed using log_flush()&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340769?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 14:31:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e7ea8a0-da1b-43c0-9f48-e5d90c57e51e</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Check out the&amp;nbsp;adc &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/structnrfx__adc__done__evt__t.html?cp=8_1_6_8_0_1_0_1"&gt;Done event&lt;/a&gt;, you will be able to acess the data from the DONE event in the evnet handler&amp;nbsp;&lt;span&gt;saadc_evt_handler. Check out how it is done in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/nrf_dev_saadc_example.html?cp=8_1_4_6_35"&gt;SAADC example&lt;/a&gt;. The log_flush does not &amp;quot;flush&amp;quot; the data away or &lt;span style="font-size:12px;"&gt;discard&lt;/span&gt;&amp;nbsp;the data.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340762?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 14:09:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:188ba3f1-c9c6-4ddc-a2f7-75a1be5bd578</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I think there might be a mix up of two different SDK&amp;#39;s here.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;There is the &lt;strong&gt;nRF5 SDK&lt;/strong&gt;,&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk_nrf5_latest.html?cp=8_1"&gt;https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk_nrf5_latest.html?cp=8_1&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;And the&amp;nbsp;&lt;strong&gt;nRF Connect SDK&lt;/strong&gt; (&lt;strong&gt;NCS&lt;/strong&gt;) ,&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk_ncs_latest.html?cp=8_0"&gt;https://infocenter.nordicsemi.com/topic/struct_sdk/struct/sdk_ncs_latest.html?cp=8_0&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And the log_flush is probably refrancing&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__log__ctrl.html?cp=8_1_6_10_30_5_1#ga2d86a60e776a72f918d2f6cf7abc3135"&gt;https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/group__nrf__log__ctrl.html?cp=8_1_6_10_30_5_1#ga2d86a60e776a72f918d2f6cf7abc3135&lt;/a&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340652?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 08:06:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d6d0bb1-d830-4384-80ed-523c2f6c7eee</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Nagaraj,&lt;/p&gt;
&lt;p&gt;Glad to hear you have made some progress in obtaining ADC readings, if so far just the raw readings.&amp;nbsp; Your original mention of function log_flush() had me curious.&amp;nbsp; I&amp;#39;ve searched all of sdk-nrf v1.6.1 and found only a single reference to log_flush():&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:courier new, courier;"&gt;./modules/lib/mcumgr/cmd/log_mgmt/port/mynewt/src/mynewt_log_mgmt.c:267: rc = log_flush(log);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I cannot tell where this function is defined.&amp;nbsp; It&amp;#39;s definition does not appear to be a part of Nordic nRF SDK v1.6.1 which I am using.&amp;nbsp; Though there is a chance that it is somehow created at build time for a given project.&amp;nbsp; I noticed that Zephyr apps have potentially one or more functions that part of Zephyr&amp;#39;s sensor API, and described in the documentation for that RTOS, but their definitions don&amp;#39;t actually exist (nor prototypes in and header files) until a Zephyr app developer creates them.&amp;nbsp; Though my understanding is incomplete, there seems to be some kind of meta-compilation step for those sensor and sensor driver API functions.&amp;nbsp; Perhaps log_flush() is generated similarly, and so its C code would not necessarily be visible before a sample app or project has been built.&lt;/p&gt;
&lt;p&gt;Your project sounds interesting, Nagaraj.&amp;nbsp; I hope you continue to make good progress.&amp;nbsp; Keep safe,&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340621?ContentTypeID=1</link><pubDate>Thu, 25 Nov 2021 01:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3919bee5-a32c-4d65-9937-99653fe699ac</guid><dc:creator>Nagaraj JP</dc:creator><description>&lt;p&gt;Thankyou Ted for the effort you have put for me.&lt;/p&gt;
[quote userid="104297" url="~/f/nordic-q-a/82059/read-differential-adc-and-print-the-value-serially-using-uart/340598#340598"]details about your starting point in terms of software libraries and targeted hardware will be useful for the community here to know[/quote]
&lt;p&gt;My&lt;strong&gt; sdk is version 17.1.0&lt;/strong&gt; and my target board is &lt;strong&gt;nrf 52840 dk board.&amp;nbsp;&lt;/strong&gt;I can now print the data in uart , only thing is that i could not access the data that the adc has converted, i first tried the single ended adc in the example and tried to integrate it with my code but there was error in compiling.&amp;nbsp; Since the example code uses log_flush for printing the data i could not find where the data is, but some raw data is been printed which is varied when the adc is varied.So my first aim is to acess the data from the single ended code and to print the data, and then to implement the differential adc and then to print that data.&lt;/p&gt;
&lt;p&gt;And im not using any RTOS in the code, it is just simply a basic implementation.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read Differential adc and print the value serially using uart</title><link>https://devzone.nordicsemi.com/thread/340598?ContentTypeID=1</link><pubDate>Wed, 24 Nov 2021 18:18:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eefd6074-0475-48b5-8608-0069f0207626</guid><dc:creator>tedhavelka</dc:creator><description>&lt;p&gt;Hello Nagaraj JP,&lt;/p&gt;
&lt;p&gt;Not sure if I can assist you, but a few details about your starting point in terms of software libraries and targeted hardware will be useful for the community here to know.&amp;nbsp; Are you working with Nordic Semi&amp;#39;s nRF Connect SDK, such as found at &lt;a href="https://github.com/nrfconnect/sdk-nrf/tags"&gt;https://github.com/nrfconnect/sdk-nrf/tags?&lt;/a&gt;&amp;nbsp; This was my starting point a few months back.&amp;nbsp; I am using Nordic&amp;#39;s sdk-nrf release version 1.6.1.&lt;/p&gt;
&lt;p&gt;If yes to this question you are most likely then working with a Zephyr RTOS based app.&amp;nbsp; I&amp;#39;ve seen some posts here, however, in which developers are working with a non-Zephyr code base or project.&lt;/p&gt;
&lt;p&gt;If your application is Nordic SDK plus Zephyr based, then you may be able to get your targeted board&amp;#39;s UART functioning quickly via the &amp;quot;hello world&amp;quot; sample app in downloaded SDK.&amp;nbsp; For myself there were several steps to download and configure the various tools and SDK software pieces, but in the end I have a `west` workspace (where `west` is, you may already know, a Python based project manager at the command line).&amp;nbsp; In that `west` workspace the `west` utility has eased the git cloning of Nordic&amp;#39;s SDK, an associated fork of the Zephyr project, and some nice sample apps both from Nordic and from Zephyr.&lt;/p&gt;
&lt;p&gt;In about a day&amp;#39;s time I was able to enable any of three on-chip UARTs in my development board&amp;#39;s microcontroller.&amp;nbsp; The &amp;quot;hello world&amp;quot; sample in [west_workspace]/zephyr/samples/hello_world contains almost no code, and its prj.conf file is effectively empty.&amp;nbsp; But as the sample app builds part of the build toolchain goes out and reads a DTS (device tree source) board file for my particular targeted board.&amp;nbsp; Capturing and reviewing the build messages, I could then study that board.dts file, and see how the UART is assigned to pins, given a default BAUD rate, and enabled in the context of Zephyr RTOS.&amp;nbsp; Those things allowed me to correctly configure my terminal emulator, and later to move between UART instances and change BAUD rate settings as needed.&lt;/p&gt;
&lt;p&gt;The minimal source file from &amp;quot;hello_world&amp;quot; provided me an include statement which I have used many times since in development versions of code:&lt;/p&gt;
&lt;p&gt;`#include &amp;lt;sys/printk.h&amp;gt;`&lt;/p&gt;
&lt;p&gt;In Zephyr based apps (Zephyr 2.6.0 in my case) this include permits me to call `printk()` family functions.&amp;nbsp; Printk() seems to behave just like `printf()`.&lt;/p&gt;
&lt;p&gt;If I have shared things you already know my apologies.&amp;nbsp; If you are just getting started in a Zephyr based project, you will likely want to study some about Device Tree Source, and the .dts and .overlay files you will and can use in Zephyr RTOS based projects.&lt;/p&gt;
&lt;p&gt;Once you can build and see correct &amp;quot;hello world&amp;quot; output, you can start to add your own custom routines and code to that project.&amp;nbsp; To pull the sample app out of Nordic&amp;#39;s larger SDK will require some additional project configuration steps.&amp;nbsp; Those lay outside the scope of your question, and are better answered by a couple of good tutorials and likely some further interaction with the forum community.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;- Ted&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>