<?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>Question about uart connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68423/question-about-uart-connection</link><description>Hi there, 
 
 I am developing an application that uses UART. I am wondering what&amp;#39;s the proper way to connect the nRF52840 to the PC. I researched online and found that I could use a serial TTL to USB converter to first connect the pins to the converter</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 17 Nov 2020 07:34:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68423/question-about-uart-connection" /><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280245?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 07:34:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:443a7407-9123-4c12-8535-68fbf9da2eea</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Yes, enough....The hardware rule you may discuss with the hardware staff in your company.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280243?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 07:20:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1f738af-8a06-4c2a-8f0c-1eeaacbaaced</guid><dc:creator>Jinyue Zhu</dc:creator><description>&lt;p&gt;Hi Henry,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks. So basically any of the two circled ground locations would suffice?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jinyue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280238?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 07:03:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e25867db-e170-436f-b95d-56ff9727e38d</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Yes! You are correct. P0.8 as rx and P0.6 as tx. connect the node which are red circle from your side. But,...You may disable the UART flow control . Because you don&amp;#39;t need the CTS and RTS pins. The following code you may take for reference....&lt;/p&gt;
&lt;p&gt;/**@brief Function for initializing the UART.&lt;br /&gt; */&lt;br /&gt;static void uart_init(void)&lt;br /&gt;{&lt;br /&gt; uint32_t err_code;&lt;/p&gt;
&lt;p&gt;const app_uart_comm_params_t comm_params =&lt;br /&gt; {&lt;br /&gt; .rx_pin_no = RX_PIN_NUMBER,&lt;br /&gt; .tx_pin_no = TX_PIN_NUMBER,&lt;br /&gt; //.rts_pin_no = RTS_PIN_NUMBER,&lt;br /&gt; //.cts_pin_no = CTS_PIN_NUMBER,&lt;br /&gt; .flow_control = APP_UART_FLOW_CONTROL_DISABLED, //APP_UART_FLOW_CONTROL_ENABLED,&lt;br /&gt; .use_parity = false,&lt;br /&gt; .baud_rate = UART_BAUDRATE_BAUDRATE_Baud115200&lt;br /&gt; };&lt;/p&gt;
&lt;p&gt;APP_UART_FIFO_INIT(&amp;amp;comm_params,&lt;br /&gt; UART_RX_BUF_SIZE,&lt;br /&gt; UART_TX_BUF_SIZE,&lt;br /&gt; uart_event_handle,&lt;br /&gt; APP_IRQ_PRIORITY_LOWEST,&lt;br /&gt; err_code);&lt;/p&gt;
&lt;p&gt;APP_ERROR_CHECK(err_code);&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;void uart_printf(const uint8_t * str)&lt;br /&gt;{&lt;br /&gt; uint_fast8_t i = 0;&lt;br /&gt; uint8_t ch = str[i++];&lt;/p&gt;
&lt;p&gt;while (ch != &amp;#39;\0&amp;#39;)&lt;br /&gt; {&lt;br /&gt; app_uart_put(ch);&lt;br /&gt; ch = str[i++];&lt;br /&gt; }&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;for using printf() directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280234?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 06:40:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82a270cd-65fb-40dc-9601-baa678194595</guid><dc:creator>Jinyue Zhu</dc:creator><description>&lt;p&gt;Hi Henry,&lt;/p&gt;
&lt;p&gt;One last question. If I were to use the first method, where I use a TTL to USB converter, I just want to confirm the pins to be used. Please consider the below snapshot.&lt;/p&gt;
&lt;p&gt;On the pca10056.h, the RX_PIN_NUMBER is 8 and the TX_PIN_NUMBER is 6. So, I should just connect the circled two pins (P0.8 and P0.6) correspondingly to the TX and RX of the converter?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Then, the last step of selecting the ground. As you have mentioned, any digital ground would suffice. For my nrf52840, would the other two circled locations work?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;These are the only three pins I need to connect to the converter, I wonder am I correct? In the .h file we also have&amp;nbsp;CTS_PIN_NUMBER = 7&amp;nbsp;and RTS_PIN_NUMBER = 5. I wonder do I need to connect those as well?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/IMG_5F00_0129.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Really sorry for disturbing you. Hope that you could help me with this.&lt;/p&gt;
&lt;p&gt;Thanks,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Jinyue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280232?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 06:20:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8b841f2-3fb7-4494-be52-5a7ec099eb26</guid><dc:creator>Jinyue Zhu</dc:creator><description>&lt;p&gt;Ah got it, thanks for the update!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280230?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 06:00:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdbac1f4-3b4e-404b-a641-4ebe03e5640e</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;A1. Any one GND can be connected to the UART ground in PC .But the better way is digital ground ,not the radio ground related to ANT+,RF,or BLE.&lt;/p&gt;
&lt;p&gt;A2,I think that you miss understand my meaning. You can monitor your UART from PC terminal using the DK virtual com port. It&amp;#39;s the direct way. However you should setup uart configuration in our code first. I suggest you can refer the SDK17 ble_app_uart example. It&amp;#39;s an easy way for start. The USB CDC means that if you want to apply for SOC USB function the other port you mention that is the SOC USB hardware interface here. It&amp;#39;s not also the CDC function. You also can use USB HID, audio function with the same port.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280229?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 05:43:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c1c9d75-1e36-4da6-aa69-64cd07478395</guid><dc:creator>Jinyue Zhu</dc:creator><description>&lt;p&gt;Hi Henry,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for this update. I have some follow-up questions, if I may.&lt;/p&gt;
&lt;p&gt;1. To clarify, I should connect the TX pin to the RX pin on the converter. Similarly, I should connect the RX pin on the board to the TX pin on the converter. I wonder what should I connect for the ground pin on the board (there are many locations on the nRF52840 that is identified as ground). I apologize for this question, as I am quite new to this development environment.&lt;/p&gt;
&lt;p&gt;2. If I decide to use the USB port for SOC as the uart port, how should I unable the CDC function? Other than modifying the sdk_config, what other steps should I do? For example, when initializing the uart, I believe that I need to pass in RX, TX pins and etc. If I use that USB port, what initialization function should I use, and what should be the corresponding RX TX pins?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I guess I am still not 100% sure what to do next. For example, if I choose the 2nd option, which entry should I modify in the sdk_config.h? I tried searching for the keyword CDC, but I am not sure which is the one I am looking for. After enabling it, would my PC then shows up an additional COM connection for the uart?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jinyue&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Question about uart connection</title><link>https://devzone.nordicsemi.com/thread/280228?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2020 05:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3b462f3-3cbf-4430-b415-0969ebfd4e1c</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Hi! Jinyue:&lt;/p&gt;
&lt;p&gt;Check your pca10056.h file . What&amp;#39;re your&amp;nbsp;RX_PIN_NUMBER &amp;amp; TX_PIN_NUMBER definition? And connect the hardware exactly. But however,the connection should be twist. The SOC TX should be connected RX from PC , and so on.By the way the USB port you mention in DK that&amp;#39;s the usb port for SOC. If you want to use as CDC , you have to enable the CDC function in sdk_config.h and your application code. But it&amp;#39;s already have the virtual com port in DK when you connect your DK with PC.You have just only enable the UART function.And you can monitor the data through com port terminal.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>