<?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>UARTE in circular mode</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28420/uarte-in-circular-mode</link><description>Hi, 
 I have a question about the UARTE peripheral.
is it possible to keep the DMA running and let it write to ram in a circular way?
I used DMA on the stm32 before and there we can set it in a circular mode.
When the ptr reached the last configured</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Jan 2018 15:37:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28420/uarte-in-circular-mode" /><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112181?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2018 15:37:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6872a9d-ffba-4ffc-905f-5c4751bf585d</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;That would probably have been a good idea. We have tried to limit this beeing a problem by dividing the RAM interface into multiple RAM AHB slaves. So if you make sure UARTE is the only (or at least the one with the highest priority) peripheral accessing a particular block / AHB slave, you can assume it will use the minimum access time wich is 2 16M cycles = 125ns. Maybe use double that to be sure. See the memory and AHB chapters in the PS for details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112182?ContentTypeID=1</link><pubDate>Fri, 05 Jan 2018 13:02:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:230ea5ad-6d4a-4d25-95e7-5fd332f7fc3d</guid><dc:creator>owl-wy7n</dc:creator><description>&lt;p&gt;It&amp;#39;s a shame that the RXDRDY event isn&amp;#39;t triggered until after DMA has moved the byte to memory.  Is that a change that could be made in a future revision of silicon?  Then these delays wouldn&amp;#39;t be necessary.  We could remove them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112180?ContentTypeID=1</link><pubDate>Wed, 03 Jan 2018 13:26:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba1defcf-1b57-470b-9aa0-8b18ce96e52c</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Not really an easy answer to that, as it would depend on what other peripherals is using the AHB bus as well. Check the AHB multilayer section in the PS. Regardless there is an UART async driver in the cli.7z pakage in this &lt;a href="https://devzone.nordicsemi.com/question/175662/nrf-cli-cannot-handle-long-arguments/"&gt;devzone post&lt;/a&gt; that would probably work for you. This driver is planned to be documented and released in SDK 15 in a couple of months.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112179?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 22:45:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:032e8c46-6121-4a67-9185-cdbcf30fecb1</guid><dc:creator>owl-wy7n</dc:creator><description>&lt;p&gt;I too would like to know how many cycles one must wait to read a value after RXDRDY event has been asserted.  Is this known?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112177?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 15:38:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f700d0b-f7be-404a-b271-8dea3d172bf8</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You can stop the uart (STOPRX), wait for the RXTO event, flush the FIFO, wait for the ENDRX event and then read the number of bytes written to RAM (AMOUNT). The time between STOPRX and RXTO event is long enough to get 59 bits/bauds on the bus, f.ex. with 250K baudrate it will take 236us.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand the problem with using a timer, you have 6 timers available and I would say only the UART peripheral is built in such way that it may need some &amp;quot;hacking&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112175?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 14:50:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:96156388-6025-4333-b535-50897342c842</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;Is there maybe a way to get all data with toggling rx off and on? I tried and everytime i miss some bits and get garbage. I reall don&amp;#39;t like using a complete timer for a simple dma counter. And I am scared what I will find when i start using other peripherals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112174?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 14:36:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:911af9da-6f01-43db-81f3-7719f558ae87</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;You are correct, sorry for that, the AMOUNT will only be updated at the ENDRX event. I don&amp;#39;t know of any other way to count the bytes other than the one you have suggested.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112173?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 14:28:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6684805f-3bd0-4bfa-93f9-25db5fe3e83c</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;I know the AMOUNT register can be read after the ENDRX event. But when I keep DMA running it will only update on the overflow moment and result in constandly the same value. Is there maybe another way to keep UARTE rx active and keep track of data without toggling rx on and off to get the AMOUNT?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112176?ContentTypeID=1</link><pubDate>Tue, 10 Jan 2017 14:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:02309db7-91ef-4c0a-a14e-e2f931c9ca07</guid><dc:creator>Ole Bauck</dc:creator><description>&lt;p&gt;If you don&amp;#39;t update the RXD.PTR before the next STARTRX task is called it will start writing to the same location. Use shortcut between ENDRX and STARTRX to keep the UARTE always in reception.&lt;/p&gt;
&lt;p&gt;Seems like figured out a way to count the data. Just remember that the data may not be written to RAM when the RXDRDY event triggers:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;For each byte received over the RXD
line, an RXDRDY event will be
generated. This event is likely to
occur before the corresponding data
has been transferred to Data RAM.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;You can also read the RXD.AMOUNT register to see how many new bytes have been transferred to the RX buffer in RAM since the last ENDRX event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UARTE in circular mode</title><link>https://devzone.nordicsemi.com/thread/112172?ContentTypeID=1</link><pubDate>Mon, 09 Jan 2017 19:45:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9433b58e-e8a1-4c90-bbcb-482949d937b0</guid><dc:creator>Martijn</dc:creator><description>&lt;p&gt;I actually created a solution using PPI and TIMER in counter mode to get the amount while keeping DMA active:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_TIMER1-&amp;gt;MODE = TIMER_MODE_MODE_LowPowerCounter &amp;lt;&amp;lt; TIMER_MODE_MODE_Pos;
NRF_TIMER1-&amp;gt;BITMODE = TIMER_BITMODE_BITMODE_16Bit &amp;lt;&amp;lt; TIMER_BITMODE_BITMODE_Pos;
NRF_TIMER1-&amp;gt;TASKS_CLEAR = 1;
NRF_TIMER1-&amp;gt;TASKS_START = 1;

NRF_PPI-&amp;gt;CH[0].EEP = (SE_UInt32)&amp;amp;pContext-&amp;gt;pUart-&amp;gt;EVENTS_RXDRDY;
NRF_PPI-&amp;gt;CH[0].TEP = (SE_UInt32)&amp;amp;NRF_TIMER1-&amp;gt;TASKS_COUNT;

NRF_PPI-&amp;gt;CH[1].EEP = (SE_UInt32)&amp;amp;pContext-&amp;gt;pUart-&amp;gt;EVENTS_ENDRX;
NRF_PPI-&amp;gt;CH[1].TEP = (SE_UInt32)&amp;amp;NRF_TIMER1-&amp;gt;TASKS_CLEAR;

NRF_PPI-&amp;gt;CHENSET =  PPI_CHENSET_CH0_Set &amp;lt;&amp;lt; PPI_CHENSET_CH0_Pos | PPI_CHENSET_CH1_Set &amp;lt;&amp;lt; PPI_CHENSET_CH1_Pos ;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This way I can keep the DMA running and the counter value indicates the current write index of the DMA. Now i can handle the data while keeping the receiver running.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>