<?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>Serial Port 2</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/78271/serial-port-2</link><description>Hi 
 Yes. I want to do something like Peripheral_uart example but I want to connect my serial device sensor to NRF5340-DK via gpio pins available. 
 Then I want to get the sensor serial data by serial port of NRF5340 and then send it via BLE to a demanding</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 06 Sep 2021 11:57:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/78271/serial-port-2" /><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/328179?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 11:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74e8db2d-d488-445b-9733-efe8a30a6f5c</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;&amp;nbsp;Hi&lt;/p&gt;
&lt;p&gt;You are right of course, the pins are in hex. Good find!&lt;/p&gt;
&lt;p&gt;For an example of an overlay file, see the lpuart sample and the file [YOUR_PATH_TO]/ncs/nrf/peripheral/lpuart/boards/nrf5340dk_nrf5340_cpuapp.overlay &lt;/p&gt;
&lt;p&gt;I can also recommend the &lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-2-ncs-v1-4-0#h180sjwjk6o5g1h84ara1cpl5hfi6jelf"&gt;nRF Connect SDK Tutorial - Part 2&lt;/a&gt;, as it describes how to change the device tree.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/328078?ContentTypeID=1</link><pubDate>Mon, 06 Sep 2021 05:05:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f7646e4-0f1f-47f3-9a77-eea62baf111d</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Actually the pin numbers you mentioned for Tx nd Rx of Uart0 are in HEX format .It means that we should&lt;/p&gt;
&lt;p&gt;use P0.20 and P0.22 at gpio. I used P0.20 as Tx and it worked properly.&lt;/p&gt;
&lt;p&gt;Now I want to changed these pins by using the .overlay file .For example I want to use P0.10 and P0.9&lt;/p&gt;
&lt;p&gt;as Tx and Rx of Urat0.&lt;/p&gt;
&lt;p&gt;How can I do this?&lt;/p&gt;
&lt;p&gt;Thank you in advance for paying attention.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/325007?ContentTypeID=1</link><pubDate>Mon, 16 Aug 2021 06:21:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:427a819c-ff4c-4f35-b7cd-1d164370fc57</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, you can use nRF Connect app for mobile.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324953?ContentTypeID=1</link><pubDate>Sun, 15 Aug 2021 03:48:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ecb1403-6154-404b-a264-7895ce08d92c</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;I am just trying to use P0.16 and P0.14.&lt;/p&gt;
&lt;p&gt;Still I have another question. With which mobile app I can receive data?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can I use nRF Connect app or I shall use another app?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324287?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 13:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b775b3fd-0252-4f75-badf-6c34047648c7</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Can you try use P0.16 as RX and P0.14 as TX?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324237?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 12:22:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32018faf-cdba-4c14-8784-015eba75765f</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;/*&lt;br /&gt; * Copyright (c) 2020 Nordic Semiconductor ASA&lt;br /&gt; *&lt;br /&gt; * SPDX-License-Identifier: Apache-2.0&lt;br /&gt; */&lt;/p&gt;
&lt;p&gt;/dts-v1/;&lt;br /&gt;#include &amp;lt;nordic/nrf5340_cpuapp_qkaa.dtsi&amp;gt;&lt;br /&gt;#include &amp;quot;nrf5340_cpuapp_common.dts&amp;quot;&lt;/p&gt;
&lt;p&gt;/ {&lt;br /&gt; model = &amp;quot;Nordic NRF5340 DK NRF5340 Application&amp;quot;;&lt;br /&gt; compatible = &amp;quot;nordic,nrf5340-dk-nrf5340-cpuapp&amp;quot;;&lt;/p&gt;
&lt;p&gt;chosen {&lt;br /&gt; zephyr,sram = &amp;amp;sram0_image;&lt;br /&gt; zephyr,flash = &amp;amp;flash0;&lt;br /&gt; zephyr,code-partition = &amp;amp;slot0_partition;&lt;br /&gt; zephyr,sram-secure-partition = &amp;amp;sram0_s;&lt;br /&gt; zephyr,sram-non-secure-partition = &amp;amp;sram0_ns;&lt;br /&gt; };&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;spi2 {&lt;br /&gt; compatible = &amp;quot;nordic,nrf-spim&amp;quot;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt; sck-pin = &amp;lt;47&amp;gt;;&lt;br /&gt; miso-pin = &amp;lt;46&amp;gt;;&lt;br /&gt; mosi-pin = &amp;lt;45&amp;gt;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;amp;usbd {&lt;br /&gt; compatible = &amp;quot;nordic,nrf-usbd&amp;quot;;&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;The above code is the&amp;nbsp; nrf5340dk_nrf5340_cpuapp.dts file in NSC.As you can see there is no&lt;/p&gt;
&lt;p&gt;Uart configuration code in this file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324222?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 11:48:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f138b77-6b01-4c6a-9ad4-37a3fb1d59b0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;It was not wrong, the zephyr.dts file contains the compiled device tree, meaning that RX should be P0.16 and TX should be P0.14. &lt;br /&gt;See the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/build/index.html#configuration-phase"&gt;Zephyr link overview&lt;/a&gt; on more information on the Zephyr build process.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;I am sorry, I was mistaken on the 0x16 and 0x14. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;In the &amp;quot;nrf52840dk_nrf52840.dts&amp;quot; file, the correct pins are listed&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration:line-through;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:line-through;"&gt;Here pins are P0.06, P0.08, P0.05 and P0.09.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In the nRF5340, the peripherals can be configured to use different pins. This is set from &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/uarte.html?cp=3_0_0_6_37_8_38#register.PSEL.RTS"&gt;registers &lt;/a&gt;in the nRF5340. However, in NCS, you do &lt;strong&gt;not &lt;/strong&gt;need to write to these registers manually. Instead, you configure the pins using &amp;quot;.dts&amp;quot; or &amp;quot;.overlay&amp;quot; files, and NCS automatically configures the nRF5340.&lt;/p&gt;
&lt;p&gt;This means you can change what pins you want to use for TX and RX if needed.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324212?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 11:26:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f44a7d7-6417-4b8e-be6e-e5a8ee15aba5</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Actually I don&amp;#39;t understand the meaning of &amp;lt;0x16&amp;gt; and &amp;lt;0x14&amp;gt;.What is its equivalent GPIO pin number&lt;/p&gt;
&lt;p&gt;in NRF5340-DK development board. As far as I searched the schematic of this board I couldn&amp;#39;t find RX&lt;/p&gt;
&lt;p&gt;and TX pins of Uart_0 to which you can connect your serial device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324208?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 11:13:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1f4d1fb-1825-4f70-af0e-36ee25bcf5f5</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Actually I don&amp;#39;t understand the meaning of &amp;lt;0x16&amp;gt; and &amp;lt;0x14&amp;gt;.What is its equivalent GPIO pin number&lt;/p&gt;
&lt;p&gt;in NRF5340-DK development board. As far as I searched the schematic of this board I couldn&amp;#39;t find RX&lt;/p&gt;
&lt;p&gt;and TX pins of Uart_0 to which you can connect your serial device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324207?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 11:12:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2179d6a8-7907-4642-833b-434ff386f57f</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Hi again&lt;/p&gt;
&lt;p&gt;Actually I don&amp;#39;t understand the meaning of &amp;lt;0x16&amp;gt; and &amp;lt;0x14&amp;gt;.What is its equivalent GPIO pin number&lt;/p&gt;
&lt;p&gt;in NRF5340-DK development board. As far as I searched the schematic of this board I couldn&amp;#39;t find RX&lt;/p&gt;
&lt;p&gt;and TX pins of Uart_0 to which you can connect your serial device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324113?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 06:51:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0aceba42-e1ce-4e11-b70c-4945d4905ec0</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Uart 0 use pins 0x13, 0x14, 0x15 and 0x16. I found this in the zephyr.dst file:&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4426.pastedimage1628576271726v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;You can use other pins than these. &lt;br /&gt;In that case&amp;nbsp; you need&amp;nbsp; to change the pin configurations, you need to change the device tree. The &lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-2-ncs-v1-4-0#h180sjwjk6o5g1h84ara1cpl5hfi6jelf"&gt;nRF Connect SDK Tutorial - Part 2&lt;/a&gt; describes how to change the device tree. I recommend the whole &lt;a href="https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial"&gt;three part tutorial &lt;/a&gt;for learning how to work with NCS, it explained the concepts very well.&lt;/p&gt;
&lt;p&gt;You should use 3.3v:&lt;br /&gt;Look at the GPIO levels in the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/regulators.html?cp=3_0_0_3_6_2#gpio_levels"&gt;Regulators documentation&lt;/a&gt; of the nRF5340.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/324101?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 03:34:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f081dc1-4d77-4135-8648-3893d466700b</guid><dc:creator>saeed mahvis</dc:creator><description>&lt;p&gt;Thank you very much for your paying attention.&lt;/p&gt;
&lt;p&gt;Yes the peripherial_uart sample seems to be a good choice for my project. But Uart 0 pins didn&amp;#39;t come out on GPIO connector&amp;nbsp;&lt;/p&gt;
&lt;p&gt;pins in NRF5340-DK development board. Can I use Uart 1 instead of Uart 0 in the peripherial_uart sample and if it is possible what is&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the logic level I should use 5v or 3.3v?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Serial Port 2</title><link>https://devzone.nordicsemi.com/thread/323638?ContentTypeID=1</link><pubDate>Fri, 06 Aug 2021 06:50:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0d20f20-4b29-4908-b606-376908fb06cb</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi Saeed&lt;/p&gt;
&lt;p&gt;From the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_uart/README.html"&gt;luetooth: Peripheral UART&lt;/a&gt; documentation: &lt;br /&gt;&amp;quot;When connected, the sample forwards any data received on the RX pin of the UART 0 peripheral to the Bluetooth LE unit.&amp;quot;&lt;/p&gt;
&lt;p&gt;This sample will send data from RX pin of UART via Bluetooth. &lt;br /&gt;Does this answer your question?&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>