<?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>Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43697/correct-use-of-nrf_log-for-display-on-termite</link><description>Hello to everyone. 
 I have a doubt about the function of NRF_LOG library in nRF52 DK. I&amp;#180;m trying to display the voltaje value from pin P0.26 on Termite, so I saw in this page that NRF_LOG_ENABLED and NRF_LOG_BACKEND_UART_ENABLED must be in 1 on sdk_config</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Feb 2019 04:46:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43697/correct-use-of-nrf_log-for-display-on-termite" /><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/172411?ContentTypeID=1</link><pubDate>Fri, 22 Feb 2019 04:46:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56d539df-3167-4242-afa9-6f4df6465ee3</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;I&amp;acute;ll try it. &lt;br /&gt;Thank you very much for the support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/172047?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 09:06:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:914ab27d-b7a0-4ed2-9101-7418416aa393</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The SAADC example will give you a digital representation of a analog signal, if you want to measure anything between high (1) and low (0), this is the example you need to use.&lt;/p&gt;
&lt;p&gt;If you want to read the digital state of a GPIO (high or low), you can use this example:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-9e647e1e58684075932391acb2f2fcc9/gpio.zip"&gt;devzone.nordicsemi.com/.../gpio.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By connecting P0.26 to either VDD or GND on the DK, the example will output 1 or 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171998?ContentTypeID=1</link><pubDate>Wed, 20 Feb 2019 01:22:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c2118ac-1a60-42e1-b3b7-527dc987c54b</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;No, It doesn&amp;acute;t work.&lt;br /&gt;SAADC is an example to get analog voltages, right? And for digital ones, is there any example?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171820?ContentTypeID=1</link><pubDate>Tue, 19 Feb 2019 09:13:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14f91c8a-9d26-4278-8da2-2b51bc3a951b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You should not set the voltage on a GPIO higher than VDD + 0.3V, as this may break the chip. See&amp;nbsp;&lt;a title="Absolute maximum ratings" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/abs_max_ratings.html?cp=2_1_0_4#abs_max_ratings"&gt;Absolute maximum ratings&lt;/a&gt;&amp;nbsp;for more details. On the DK, VDD is typically between 2.8-3.0 V. Try connecting the GPIO to VDD on the DK and see if it reads 1.&lt;/p&gt;
&lt;p&gt;If you want to measure analog voltages, you need to use the SAADC peripheral. See the &lt;a href="https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-2-0/nrf_dev_saadc_example"&gt;SAADC example&lt;/a&gt; in the SDK for how to use it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171760?ContentTypeID=1</link><pubDate>Tue, 19 Feb 2019 01:04:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a70e19f8-4f1d-434b-b1f6-c33d176326a8</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;&lt;span&gt;I just tried to raise the voltage to 3.5V, but it does not work. I also tried to directly connect a DHT11 temperature and humidity sensor with digital output to the P0.26 pin, but it still prints 0 in Termite. Do I need an extra configuration for being a digital sensor or should it work?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171751?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 22:06:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9bc2622-3098-4237-a4ab-b0b1d1ac7e2d</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;Ok, I understand.&lt;br /&gt;So, I have to put like 3.5V to reach 1, right? because I&amp;acute;m feeding my circuit with 5V.&lt;br /&gt;And, if GPIO only allows me to have 1 and 0, there&amp;acute;s an option to get the real value in voltage?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171641?ContentTypeID=1</link><pubDate>Mon, 18 Feb 2019 13:30:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b24d5f4-93bc-4cad-a767-89ff136fb24e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can only read 1 and 0 from the GPIO. The&amp;nbsp;&lt;span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpio.html?cp=2_1_0_19_3#unique_1820404704"&gt;Input high voltage&lt;/a&gt; is defined at 0.7 * VDD. If you apply 1 V to the pin, you will not go above this limit, and the state will be low.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171488?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 23:11:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a80b74b3-5ac2-465b-819d-37c358a4eae5</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int main(void)
{
    // Initialize.
    log_init();
    leds_init();
    timers_init();
    buttons_init();
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    advertising_init();
    conn_params_init();
	
	nrf_gpio_cfg_input(26, NRF_GPIO_PIN_PULLDOWN);
	uint32_t pin_state = nrf_gpio_pin_read(26);

    // Start execution.
    NRF_LOG_INFO(&amp;quot;Blinky example started.&amp;quot;);
	NRF_LOG_INFO(&amp;quot;Pin state: %d&amp;quot;, pin_state);
    advertising_start();

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}&lt;/pre&gt;I&amp;acute;m actually cheking the code with &amp;quot;ble_app_blinky&amp;quot; example, because all the configurations to use LOG are already set, but I can&amp;acute;t make it work. I adjusted the original code with my own lines (16, 17, 21) and only prints the message &amp;quot;Pin state: 0&amp;quot;, no matter if I introduce up to 1V of power.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171333?ContentTypeID=1</link><pubDate>Fri, 15 Feb 2019 10:34:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ef0c3ca-f331-4288-a935-a1e21b841553</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I see that you have not initialized the log module in your application. You need to add this header file to the top of main.c:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#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;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;and these lines in start of main-loop:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);

NRF_LOG_DEFAULT_BACKENDS_INIT();&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171263?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 23:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deac1c02-5e8e-4ba2-87dd-f919cff708dd</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;Hello Jorgen, thank you for answer.&lt;br /&gt;I can compile the program now, but I can&amp;acute;t see anything in Termite. I&amp;acute;m using a sdk_config.h file from an example that doesn&amp;acute;t need SoftDevice (blinky / PCA100040 / blank).&lt;br /&gt;The original config file didn&amp;acute;t has the&amp;nbsp;&lt;span&gt;NRF_LOG_ENABLED and NRF_LOG_BACKEND_UART_ENABLED lines, so I added them copying from another sdk_config.h file (ble_app_blinky / PCA100040 / s132), but only those two functions.&lt;br /&gt;I need to copy all the NRF_LOG functions? like BAUDRATE and TEMP_BUFFER_SIZE?&lt;br /&gt;My question is because I&amp;acute;m not sure I&amp;acute;m using the correct Baudrate to link with Termite.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171046?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 09:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8620af0d-5530-4d2b-a000-7afc6dedeeff</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you want to get the state of the pin, you need to read the pin and store its value to a variable. You can then pass the variable to NRF_LOG:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uint32_t pin_state = nrf_gpio_pin_read(26);
NRF_LOG_INFO(&amp;quot;Pin state: %d&amp;quot;, pin_state);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;NRF_LOG use printf format to format the strings.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/171007?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 05:51:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5eb97b8-b844-4a88-8f96-b2c1c3b04b90</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;Correction about the mistake: isn&amp;#39;t line 20, I&amp;#39;m talking about line 24.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Correct use of NRF_LOG for display on Termite</title><link>https://devzone.nordicsemi.com/thread/170996?ContentTypeID=1</link><pubDate>Thu, 14 Feb 2019 00:32:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba83113d-b2a5-4cd4-8600-27255f9ac066</guid><dc:creator>JK0201</dc:creator><description>&lt;p&gt;I&amp;acute;m sorry, the first 4 lines are wrong. Please don&amp;acute;t pay attention to them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>