<?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>Strange UART behaviour</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8813/strange-uart-behaviour</link><description>Hello fellow devlopers. 
 I am experienceing very odd behaviour from the UART peripheral.
I am trying to ouput a uint8_t[48] array from the UART termainl. I am using this simple code 
 while (i &amp;lt;48) 
{
uint8_t UART_Val;
UART_Val = Meta_data[i];</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Aug 2015 07:18:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8813/strange-uart-behaviour" /><item><title>RE: Strange UART behaviour</title><link>https://devzone.nordicsemi.com/thread/32347?ContentTypeID=1</link><pubDate>Thu, 20 Aug 2015 07:18:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71d31d27-f4de-4662-8a36-e4a3102a49e3</guid><dc:creator>Raiyans</dc:creator><description>&lt;p&gt;still shows the same behaviour as before. in any case, STARTTX is already set in the simple_uart_config function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange UART behaviour</title><link>https://devzone.nordicsemi.com/thread/32346?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 14:03:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c546a93-f0f5-4418-8f11-7e0eec2da7a0</guid><dc:creator>Wojciech Jasko</dc:creator><description>&lt;p&gt;NRF_UART0-&amp;gt;TASKS_STARTTX = 1;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange UART behaviour</title><link>https://devzone.nordicsemi.com/thread/32343?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 13:42:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1098b8e-8879-4478-82ae-e64c7f286285</guid><dc:creator>Raiyans</dc:creator><description>&lt;p&gt;mhm..I am just trying to read uint8_t data. There is simple funciton provided in the UART library found in the SDK that can do this which am using. The thing, I am unable to tell if the loop executes completely or not because when I try to debug the program, everything runs perfectly. Am thinking this is because when your are debugging you are giving good time for the handshake synchonisation between the PC and the nordic chip. I have tried to add delay but could not get it to work. Strange indeed&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange UART behaviour</title><link>https://devzone.nordicsemi.com/thread/32345?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 13:38:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfa78d73-396a-469b-bbc0-ce701fb03d6b</guid><dc:creator>Raiyans</dc:creator><description>&lt;p&gt;Thank  you Michael for your quick reply...I actually am using the exmaple code. I was using the c library stright but ended up coping the fuction into my main code and adjusting it from here as the debugging was easier.. with regard to your code..I am not able to compie as I get an error struct &amp;quot;&amp;quot; has no field &amp;quot;NRF_UART_TASK_STARTTX&amp;quot;  :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange UART behaviour</title><link>https://devzone.nordicsemi.com/thread/32344?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 12:38:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd459ec-2db5-4410-aa6f-ecba99e3f198</guid><dc:creator>Michael Dietz</dc:creator><description>&lt;p&gt;You need to trigger a task.&lt;/p&gt;
&lt;p&gt;I would try&lt;/p&gt;
&lt;p&gt;while (i &amp;lt; 48)
{&lt;/p&gt;
&lt;p&gt;uint8_t UART_Val;
UART_Val = Meta_data[i];&lt;/p&gt;
&lt;p&gt;NRF_UART0-&amp;gt;EVENTS_TXDRDY = 0;&lt;/p&gt;
&lt;p&gt;NRF_UART0-&amp;gt;NRF_UART_TASK_STARTTX = 1;&lt;/p&gt;
&lt;p&gt;NRF_UART0-&amp;gt;TXD = UART_Val;&lt;/p&gt;
&lt;p&gt;while (NRF_UART0-&amp;gt;EVENTS_TXDRDY != 1)
{&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Wait for TXD data to be sent.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt;i++;
}&lt;/p&gt;
&lt;p&gt;but check out the example uart code in the SDK. and why arent you using that - it simplifies things?&lt;/p&gt;
&lt;p&gt;let me know if it works!&lt;/p&gt;
&lt;p&gt;-Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Strange UART behaviour</title><link>https://devzone.nordicsemi.com/thread/32342?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 12:21:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c51a9839-77a7-4c50-9a5a-bff96c685cb8</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hi.
What program are you using to receive the uart string? If the program expects a text string it will for example terminate on 0x00 characters or &amp;#39;\n&amp;#39; (newline) characters. See if you can print the data as raw values on the receiver end. You can also try to vary the contents of the Meta_data array, to see if this has any effect. Does the while loop finish or does it crash after 2-3 iterations?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>