<?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>2 UARTs on 51422</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12553/2-uarts-on-51422</link><description>Hi, 
 I have a hardware (wired) UART transmitting data to the nRF51 at intervals. I&amp;#39;m currently trying to implement UART-BLE that runs could concurrently with the wired UART. 
 How should I go about doing that (uart event handler and uart initialization</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Mar 2016 16:44:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12553/2-uarts-on-51422" /><item><title>RE: 2 UARTs on 51422</title><link>https://devzone.nordicsemi.com/thread/47654?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2016 16:44:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d6cbbfe-9942-44dc-8fab-7827db4f5a96</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The uart_evt_handler is callback function for the hardware UART. The nus_data_handler is the callback function for the BLE-UART messages. The nus service is initialized in the services_init function, where the BLE-UART nus_data_handler callback is set.&lt;/p&gt;
&lt;p&gt;You can see in the nus_data_handler in the example that the data received from BLE-UART is directly forwarded to the hardware UART. You can also see in the uart_event_handle that data received on the hardware UART is directly forwarded to the BLE-UART. This means that the data can flow in both directions, from a BLE peer device to a hardware connected UART device, and also from hardware connected UART device to a BLE peer device.&lt;/p&gt;
&lt;p&gt;You can connect to the hardware UART with a UART terminal program on your PC, e.g. Realterm, and communicate with for example Master Control Panel on Win PC or any BLE analyzing app on your smartphone, or most simply, use the nRFToolbox UART app, available for IOS, Android and windows phone&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 UARTs on 51422</title><link>https://devzone.nordicsemi.com/thread/47653?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2016 17:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10f6923d-ea3c-4455-9135-a4e3c71018ab</guid><dc:creator>leehong</dc:creator><description>&lt;p&gt;Or to rephrase it, how do i know which data is coming from hw uart and ble-uart from the uart_evt_handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 UARTs on 51422</title><link>https://devzone.nordicsemi.com/thread/47652?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2016 17:12:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b1f65b8-7e96-4b23-857d-8dad536d98b2</guid><dc:creator>leehong</dc:creator><description>&lt;p&gt;Hi Stefan,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking to receive data from 2 ends independently:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;From hardware UART (receiving data from another chip)&lt;/li&gt;
&lt;li&gt;From BLE-UART (receiving data from mobile app)&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Also, due to my hardware limitation, I&amp;#39;m only able to use the same UART pin for both wired uart and ble-uart. I don&amp;#39;t think it is covered in SDK&amp;#39;s BLE UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 2 UARTs on 51422</title><link>https://devzone.nordicsemi.com/thread/47651?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2016 17:07:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1df09a84-55a1-48f7-a646-93fb81206abd</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I suspect the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/ble_sdk_app_nus_eval.html?cp=4_0_0_4_2_2_18"&gt;BLE UART example&lt;/a&gt; in the nRF5 SDK does just what you are asking for. Otherwise let me know. It implements communication over the hardware UART and sends the data to a peer device over BLE using the NUS (Nordic UART Service).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>