<?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>High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19057/high-fequency-uart-transmissions</link><description>I am using the nrf52832 with its Development kit to transmit trough UART to the PC a frame with 26 bytes, I have configured the port to 1MBoudRate. Once I prepare the frame I use the next instructions to transmit: 
 while(nrf_drv_uart_tx_in_progress</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 05 Feb 2017 17:51:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19057/high-fequency-uart-transmissions" /><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73679?ContentTypeID=1</link><pubDate>Sun, 05 Feb 2017 17:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03deff0f-b9cd-4d79-964d-1ac13c709551</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;I don&amp;#39;t think you could achieve 104KB/s with 1MBaud.  You&amp;#39;ll need to go up to 2MBaud but nRF chip max at 1MBaud only.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73678?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 14:36:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9b5589a-e932-4867-9eba-961a099f8bd5</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;Knowing that I am using the nrf_drv_uart, how can I do to use alse the App_uart_fifo. Is this possible? Do you think that it could help in my case?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73677?ContentTypeID=1</link><pubDate>Fri, 03 Feb 2017 10:20:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d166d64f-3479-4d63-9be3-612bed33ea7c</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;The UART/UARTE peripheral does have a FIFO, but this is for RX and only used in special cases, do a search for FIFO &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/uarte.html?cp=2_2_0_34_3#concept_uzb_p2m_wr"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The UARTE use easyDMA, so you can set up a buffer that should be sent, this is what is done with the nrf_drv_uart_tx(..).&lt;/p&gt;
&lt;p&gt;App_uart_fifo sets up a FIFO in software using the app_fifo library. This is not to be confused with the UART peripheral RX FIFO.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73676?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 16:41:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8ce8bc6-4896-4f34-99c0-441b8a9215ba</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;But the nrf_drv_uart driver shouldn&amp;#39;t imply that it is using the FIFO on a lower level?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73675?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 15:00:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cee5260e-fc73-4b6d-a993-d3c69a5ec27d</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Yep, you need to use app_uart_fifo.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73674?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 14:44:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bc27d0a-dd9b-4c59-bce6-e336c629d489</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;The fact that I am using nrf_drv_uart implies that I am NOT using the FIFO?  I though that I was using it but I am programming it on a higher level, just that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73673?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 12:57:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a64dc173-c37f-4369-ab02-b1d0b99d1631</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;FIFO is a must for high speed but it depends also on the other side if the device can keep up with the speed.  The Segger onboard of the DK cannot do 1MBaud without flow control.  Top speed of the Segger is about ~45KB/s.   You&amp;#39;re tx fifo is likely to always be full. So it will either drop or block.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73672?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 12:39:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae863278-09c2-4b1e-a688-888ca086e202</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;But If I use the FIFO properly, couldn&amp;#39;t this help to fix the problem?  How can I use properly the FIFO? just not using the while(nrf_drv_uart_tx_in_progress()){} statement?
I try that together with disabling the flow Control, and I receive frames that are not complete but not with a static number of bytes in between as before.  However, here I don&amp;#39;t see any significant change if I vary the size of the TX_BUF_SIZE which for me it does not have any sense.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73680?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 12:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d6a4832-76a1-407a-8c38-63731d660b51</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;I just saw in your first question that you actually don&amp;#39;t use app_uart after initialization, but you use nrf_drv_uart directly:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;while(nrf_drv_uart_tx_in_progress()){}; nrf_drv_uart_tx(finalframe ,26);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So the FIFO in app_uart_fifo is not used, which is why it does not make any difference if you set 1,256 or 1024 as the tx buffer size.&lt;/p&gt;
&lt;p&gt;nrf_drv_uart_tx_in_progress will not return until all bytes in nrf_drv_uart_tx is sent. The transmission will be delayed if CTS line is addressed in the transfer.&lt;/p&gt;
&lt;p&gt;Your problem is not on the nRF, but on the device in the other end of the UART. I do not have numbers on how fast the Interface/debugger chip (SEGGER chip) on the DK can send data to the computer, but your test leads me to believe that it is slower than 1MBaud (100KB/s).&lt;/p&gt;
&lt;p&gt;You could use RTT instead, but the interface chip is limited to 1MHz which will probably not give you 100KB/s when including the overhead. Other alternatives is to use an external debugger with higher speed than 1MHz or to use another UART-to-USB chip like the FTDI.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73671?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 10:51:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:183fa9ff-d326-42e8-a9a1-fb0a2fd8d1ab</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;No, I have just checked and I don&amp;#39;t get any &lt;code&gt;APP_UART_FIFO_ERROR&lt;/code&gt; on the UART handler. No matter the value that I put on the &lt;code&gt;TX_BUF_SIZE&lt;/code&gt;.
The only thing is that if I put a number on TX_BUF_SIZE that is not power of 2, then the UART module does not work.
But there is no difference or error if I put 1, 256 or 1024 on &lt;code&gt;TX_BUF_SIZE&lt;/code&gt;.&lt;br /&gt;
What other evaluation can I do to verify if the problem is related with the FIFO?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73670?ContentTypeID=1</link><pubDate>Thu, 02 Feb 2017 10:05:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40ed96d0-354f-411d-baaa-44e8a566184b</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;RTS - Ready To Send - is an output on the nRF. This pin is set high when the nRF is unable to receive more bytes.&lt;/p&gt;
&lt;p&gt;CTS - Clear To Send - is an input on the nRF. It will be controlled by the other device (the virtual COM port on your PC in your case). If this is set high and the UART is set up to use flow control, the nRF will stop sending data.&lt;/p&gt;
&lt;p&gt;If the flow control is working correctly you should not see any data on the TX line while CTS is high.&lt;/p&gt;
&lt;p&gt;It sounds to me like the FIFO (app_uart_fifo) is not working correctly if it is no difference in the buffer size you set. I assume you are talking about the &lt;code&gt;TX_BUF_SIZE&lt;/code&gt; used in &lt;code&gt;APP_UART_FIFO_INIT(..)&lt;/code&gt;. Do you get any &lt;code&gt;APP_UART_FIFO_ERROR&lt;/code&gt; event in the uart event/error handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73669?ContentTypeID=1</link><pubDate>Wed, 01 Feb 2017 17:36:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82e8f853-05de-4874-940a-be4bf9d4e43f</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;Ok some updates:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I enabled flow Control and it works better, however, using the oscilloscope I see that I have a CTS signal that indicates a suspension of my UART transmission, I observe this on the data that I am receiving, some frames (around 256 bytes) are not received.&lt;/li&gt;
&lt;li&gt;I am using the UART driver module and initiating the UART with the function APP_UART_FIFO_INIT(...) so I assume that I am enabling the fifo OK. However, one curious thing is that I do not see any important effect when I change the size of the buffer from 1 to 1024 or vice-versa.
I think that the error is related with the FIFO itself. However, I don&amp;#39;t know if the CTS signal is settled by the uC itself or by the PC that is receiving the data through UART.
Does anyone have an idea of what I am missing?&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73664?ContentTypeID=1</link><pubDate>Wed, 18 Jan 2017 11:33:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f163cc96-d722-45e7-98b8-b90b0e0f10aa</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;Sending 26 bytes of data every 250us with 1Mbaud is not possible if you are using 1 startbit, 1 stopbit and 8 databits. The maximum theoretical speed using 1Mbaud is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 1Mbaud per second / 10 bauds(bits) per byte = 100KB/s
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The real number would be lower when taking into considerations time between the bytes and overhead in the CPU.&lt;/p&gt;
&lt;p&gt;This does not explain why you lose a byte though. Which byte is missing (first, last, in the middle)? Better hook up your oscilloscope/logic analyzer to see what is actually happening.&lt;/p&gt;
&lt;p&gt;Also, with 1MBaud the RX/TX lines should be very short or else you will get problems.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73668?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 19:08:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:43794f2d-9c15-4acb-a761-974d822e2640</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;do you use app_fifo with it?  1Mbaud is to fast without fifo. If all failed, you try th uart driver from &lt;a href="http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html"&gt;this blog&lt;/a&gt;.  It is approx 25% faster than the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73667?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 18:03:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6f333fa-a493-4327-97f8-4599b053cb01</guid><dc:creator>SRA</dc:creator><description>&lt;p&gt;I think it&amp;#39;s probably time to look at a logic analyzer or scope.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73666?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 16:41:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:022460a9-00db-44f7-bddd-92eab1467204</guid><dc:creator>User1321</dc:creator><description>&lt;p&gt;If I enable it, it does not work at all.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High Fequency UART transmissions</title><link>https://devzone.nordicsemi.com/thread/73665?ContentTypeID=1</link><pubDate>Tue, 17 Jan 2017 16:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aaf0dc9b-9aaa-49c3-b5e8-4ac0a4f35504</guid><dc:creator>Daniel Wang</dc:creator><description>&lt;p&gt;Have you enabled flow-control?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>