<?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>Sending via Uart</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4399/sending-via-uart</link><description>Hi,
I need to be able to communicate between two boards via UART. I had a look at the example from Ole provided here: devzone.nordicsemi.com/.../ as well as other references here on the Dev zone and code examples in the SDK. 
 I am running the PCA10001</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Jan 2015 11:42:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4399/sending-via-uart" /><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15634?ContentTypeID=1</link><pubDate>Mon, 12 Jan 2015 11:42:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be80e951-4238-4c4a-b7f5-ee381538fb2a</guid><dc:creator>Nelson</dc:creator><description>&lt;p&gt;May I know how do you put second parameter into the function of app_uart_init?
Because there using &amp;quot;NULL&amp;quot; for non-FIFO situation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15633?ContentTypeID=1</link><pubDate>Tue, 18 Nov 2014 10:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc68b51c-ba39-4b41-a573-ba154faaa3db</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;The app_uart_fifo library solved this issue, thanks for the assistance!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15621?ContentTypeID=1</link><pubDate>Fri, 14 Nov 2014 15:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a1991f1-dab7-43e1-91f2-60aff70d1aff</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;Yes, I think I may have made it even more confusing with the 6 byte buffer comment. That&amp;#39;s a receiver buffer. If you switch the uart driver you use there&amp;#39;s a different uart driver implementation with built in fifo. So if you go in the source folder and app_common and use the driver name &amp;quot;app_uart_fifo.c&amp;quot; you&amp;#39;ll find the exact same function calls as you are using, but implemented with fifo to buffer both tx and rx UART. Then you should be able to write to the uart as you are trying to do.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15623?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2014 11:54:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea217ac-7684-405c-92b5-2edcce7305c5</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;The board goes to the NO_MEM error immediately after sending the first byte, because the UART_READY event has not been enabled yet. The app_uart_put(uint8_t byte); function writes the byte to the m_tx_byte buffer but there is no space for the next byte as the board has not finished writing the previous byte. I can&amp;#39;t really see how the buffering works here and it seems like the code in the app_uart library is not working up to specification ?
I understand that I am trying to push bytes to the app_uart_put function too fast but if the board has a 6 byte buffer my problem should not appear when trying to send byte number 2 ?
Thanks for taking the time to follow this through, I appreciated it!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15624?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2014 11:50:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:619b2e3f-8654-4bea-b2b9-2361b5de9561</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;Using nRFgo Studio I can program the N5 chip and currently running s110 v7 there.&lt;/p&gt;
&lt;p&gt;I am all up for rewriting the Uart example, and I only used that for base in my project. What I don&amp;#39;t like is changing the SDK as it might give problems later in the production if/when we decide to use a newer SDK from Nordic and then changes can easily be forgotten.&lt;/p&gt;
&lt;p&gt;In the current scenario I am using the app_uart library from Nordic which is giving me this headache, I could ofcourse just write a wrapper send function which solves this buffer issue but I feel like there should be a simpler solution.
With the logical analyser I tested the sending part again (I tested with buffer sizes in the app_uart init function both 2 and 6 bytes for rx/tx). The CTS line is held low the entire time so there should be no restriction in sending characters from the PC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15626?ContentTypeID=1</link><pubDate>Wed, 12 Nov 2014 13:33:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d95292ed-4276-4c98-8430-14c22684707e</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;I do see the concern that you don&amp;#39;t want to modify the UART example, but here you are writing faster than you are sending and you have to take care not to overflow the TX buffer. So the wait operation should improve the situation as you see. How are the flow control pins behaving during this? Are you getting feedback indicating that the UART is ready to send more?&lt;/p&gt;
&lt;p&gt;SIDENOTE:
I might have side tracked you since you have problems with the TX buffer and I was talking about the receiver buffer. Just to clarify I would like to follow up anyways. If you have nRF51822 with the G0 version mentioned above I would recommend you to try out your setup on that one to see if the extra buffer size would solve your issue.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure which version of the nRF51422 that Dynastream are using/have used on their N5 modules, but it could potentially be an elder version of this module you have with a first revision of the nRF51422. This could be easily identified by whether or not you are able to program softdevice on the module or not. The first version of the nRF51422 had the ANT softdevice/stack hardcoded onto ti. If you can program a different softdevice to the module, you have revision 2 of the chip and the additional UART buffer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15630?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 15:18:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ad906dd-62ee-4394-a8ce-d1397a9ad627</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;The Uart will be more than sufficient for the amount of data that needs to be transferred between the devices. There was a decision in the project to use Uart for the communication which cannot be changed at this point. The communication works as long as I take care not to send the data too fast but but I feel that is a bad hack and could be optimized more.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15629?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 15:12:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:baa0fabc-37c6-4bd7-92cd-5f1e5975df45</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;The LPC1769 can go up to 921600.  Since you plan to put on the same PCB, why not try with SPI or I2C.  It can be faster than UART.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15628?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 14:58:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:341e5566-f1db-47e9-9bcb-8da3a4596f77</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;Not the fastest but currently using 460800&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15625?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 14:45:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd37195e-0fa3-4344-b964-4af5b18db716</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;Currently using the N5 chip from Dynastream which is based on the nRF51422. I did not find which revision they are basing their chip on but I did also try the same with other Nordic evaluation kits (using the corresponding libraries of course) with no luck. I have a few evaluation kits from Nordic (both 51822 and 51422, e.g. PCA10001, PCA10003 and more) and also the N5 chip from Dynastream (M8CB based on nRF51422) which I could also test this on if necessary.&lt;/p&gt;
&lt;p&gt;The end product will be the N5 chip communicating over UART to a LPC1769 from NXP. Using the LPC as the main processing unit and the N5 chip for BLE communication in the platform.&lt;/p&gt;
&lt;p&gt;To simplify things I am currently testing this against my PC using a UB232R serial module and a logical analyzer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15632?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 14:40:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09310afc-582d-4bd8-80ea-3a6611f7d90d</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Have you tried to set the fastest baud rate ? The default of the library is pretty slow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15622?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 14:27:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6102b5be-9ba3-4ff6-857b-072c88ab8b96</guid><dc:creator>Asbj&amp;#248;rn</dc:creator><description>&lt;p&gt;Which version of the nRF51822 are you using. There was an increase in the UART buffers between revision 1 and revision 2 of the chip from 2 byte to 6 bytes.&lt;/p&gt;
&lt;p&gt;nRF51822 QFAAC0 is first revision.
nRF51822 QFAAG0 is second revision.&lt;/p&gt;
&lt;p&gt;You have at least two nRF51822 or are you planning on having two different UART chips talking to each other? What&amp;#39;s the setup you are actually looking for?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15631?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 11:28:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e5c9ead-9aac-4684-8b6a-1dc03bdceb5e</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;Unfortunately this did not help me.
The setup of the Uart and the sending of characters is the same I have tried, however to simplify things I am sending the characters straight through the app_uart_put function without any app schedulers. I need to be able to send the data very fast as this will serve as a inter PCB communication channel.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15619?ContentTypeID=1</link><pubDate>Tue, 11 Nov 2014 11:12:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4cc0fce-98b8-42a0-8350-88cddafcc93e</guid><dc:creator>kagislason</dc:creator><description>&lt;p&gt;Hi, in the end these chips will be on the same PCB.
Currently testing this with a UB232R module to the PC, I am also monitoring the traffic using a logical analyser and the data output is as expected.&lt;/p&gt;
&lt;p&gt;My headache comes from the way the board sends the data, it seems like the channel is clogging up when trying to send the characters too fast. I have been able to temporarily fix this issue by putting a 20us delay between sending of each character or simply spinning an empty loop until the UART is ready again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15620?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2014 21:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bacc364b-3341-480a-88aa-e313ad95f70e</guid><dc:creator>Blake</dc:creator><description>&lt;p&gt;Assuming you are using USB to connect via UART, I suggest plugging into a PC and monitoring the UART output. Unix screen (&lt;a href="http://aperiodic.net/screen/man:window_types#tty_windows)"&gt;aperiodic.net/.../man:window_types&lt;/a&gt; can do this.&lt;/p&gt;
&lt;p&gt;Once you are sure the data being output is in the format you expect, you can integrate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending via Uart</title><link>https://devzone.nordicsemi.com/thread/15627?ContentTypeID=1</link><pubDate>Mon, 10 Nov 2014 21:37:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e559dd58-2407-4ea8-8c4d-acb71cd58bce</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;There is another UART example from this blog you may try &lt;a href="http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html"&gt;embeddedsoftdev.blogspot.ca/.../ehal-nrf51.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>