<?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>nrf52832 uart tx problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39410/nrf52832-uart-tx-problem</link><description>Hi, 
 I use UARTE peripheral when i communicate wih PC. 
 This code works. Send 4 bytes. 
 bno_tx_buf[0]=0xAA; bno_tx_buf[1]=0x01; bno_tx_buf[2]=0x00; bno_tx_buf[3]=0x01; 
 NRF_UARTE0-&amp;gt;TXD.MAXCNT = 4 ; NRF_UARTE0-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;bno_tx_buf[0]; NRF_UARTE0</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 12 Oct 2018 14:45:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39410/nrf52832-uart-tx-problem" /><item><title>RE: nrf52832 uart tx problem</title><link>https://devzone.nordicsemi.com/thread/152725?ContentTypeID=1</link><pubDate>Fri, 12 Oct 2018 14:45:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:867c148d-926d-4555-b613-af79b0417aa8</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You need to clear the ENDTX event after your first transfer. Otherwise ENDTX = 1&amp;nbsp;once you start your next transfer and the code doesn&amp;#39;t stop in the second&amp;nbsp;&lt;em&gt;while (NRF_UARTE0-&amp;gt;EVENTS_ENDTX == 0)&lt;/em&gt; loop, but powers through instead, and stops the UART before the second transfer has started.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;...
NRF_UARTE0-&amp;gt;TXD.MAXCNT = 2 ; 
NRF_UARTE0-&amp;gt;TXD.PTR = (uint32_t)&amp;amp;bno_tx_buf[0];
NRF_UARTE0-&amp;gt;TASKS_STARTTX = 1;
while (NRF_UARTE0-&amp;gt;EVENTS_ENDTX == 0)
{
}
NRF_UARTE0-&amp;gt;EVENTS_ENDTX = 0; // &amp;lt;- CLEAR ENDTX EVENT AFTER USE

NRF_UARTE0-&amp;gt;TASKS_STOPTX = 1;
while (NRF_UARTE0-&amp;gt;EVENTS_TXSTOPPED == 0);

//delay

NRF_UARTE0-&amp;gt;TXD.MAXCNT = 2 ; 

NRF_UARTE0-&amp;gt;TASKS_STARTTX = 1;
...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>