<?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>UART Reception only 6 bytes</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5214/uart-reception-only-6-bytes</link><description>Hello, 
 Using the &amp;quot;simple_uart_get_ with_timeout&amp;quot;,I cannot receive a &amp;quot;frame&amp;quot; bigger than 6 bytes.
Why? 
 while(simple_uart_get_with_timeout(1, &amp;amp;UART_RX[receivedBytes])){receivedBytes++;}
 
 How to deal with this problem? 
 thank you!</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Jan 2015 02:28:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5214/uart-reception-only-6-bytes" /><item><title>RE: UART Reception only 6 bytes</title><link>https://devzone.nordicsemi.com/thread/18278?ContentTypeID=1</link><pubDate>Wed, 21 Jan 2015 02:28:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83fd5ba2-e7fb-4138-99a9-ec1e6c332369</guid><dc:creator>Charles Manning</dc:creator><description>&lt;p&gt;When you wait for up to 1msec this is not long enough for a byte to arrive. Therefore once you have read the bytes in the FIFO the next byte you wait for will take too long and the loop will timeout and exit.&lt;/p&gt;
&lt;p&gt;By lengthening the timeout you are waiting for longer, therefore there is time for another byte to arrive, so the call does not time out and the while loop continues.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Reception only 6 bytes</title><link>https://devzone.nordicsemi.com/thread/18275?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2015 16:26:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02fb6af8-c7a9-402d-9e9e-dd40611a1b31</guid><dc:creator>Paul</dc:creator><description>&lt;p&gt;When you have 1ms as timeout, you can receive all 6 bytes in the FIFO right away. Probably before your software runs to &lt;code&gt;simple_uart_get_with_timeout&lt;/code&gt;, the 6 bytes already received by UART. But for the 7th byte to come into the UART, it will take time based on your BAUDRATE. 1ms is not enough if your baudrate is less than 9600.
450ms sure works. :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Reception only 6 bytes</title><link>https://devzone.nordicsemi.com/thread/18277?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2015 15:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1b98407-2a3f-4fd0-bd7b-bd1d487d3bc0</guid><dc:creator>ting&amp;#178;</dc:creator><description>&lt;p&gt;thank you!
I have another question, when increase the time out to 450ms.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(simple_uart_get_with_timeout(400, &amp;amp;UART_RX[receivedBytes])){receivedBytes++;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After 2 or 3 sendings, it works. All bytes are received.
How to explain this ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UART Reception only 6 bytes</title><link>https://devzone.nordicsemi.com/thread/18276?ContentTypeID=1</link><pubDate>Tue, 20 Jan 2015 14:50:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da709a2b-eb53-4831-adde-ff79235f84bd</guid><dc:creator>John</dc:creator><description>&lt;p&gt;Best guess: On the latest nRF51 chips the UART FIFO is 6 characters. I suspect the FIFO is already full when you start polling the data out of the FIFO. If you don&amp;#39;t have HW flow control turned on it is likely any further characters transmitted by the other side have been dropped. If you do have HW flow control turned on perhaps your other side doesn&amp;#39;t resume transmitting quickly enough after you begin polling the characters out of the FIFO.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>