<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem in receiveing bytes from uart in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problem-in-receiveing-bytes-from-uart-Zigbee-MC1321X/m-p/183251#M13525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;your problem is that you think that UartRxCallBack() is run when the uart has received all data.&lt;BR /&gt;But the callback is run as soon as some data (even only 1 byte) is received.&lt;BR /&gt;I suppose that the callback is run twice (first time after the first byte, second time after the second byte).&lt;BR /&gt;&lt;BR /&gt;If the callback is run, and only 1 byte is in the buffer I think that the first getbyte() get the true data, but the second get nothing (buffer empty).&lt;BR /&gt;So the second time the callback is called (when the second byte arrived) the data in UartByte[0] is overwritten with the second byte you sent.&lt;BR /&gt;&lt;BR /&gt;All this is IMHO, I never used zigbee, so I'm not sure about the behaviour of this processor, but usually the behaviour of uart is something like this.&lt;BR /&gt;&lt;BR /&gt;Bye Jack&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Sep 2008 21:16:39 GMT</pubDate>
    <dc:creator>jag</dc:creator>
    <dc:date>2008-09-03T21:16:39Z</dc:date>
    <item>
      <title>problem in receiveing bytes from uart - Zigbee MC1321X</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problem-in-receiveing-bytes-from-uart-Zigbee-MC1321X/m-p/183250#M13524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Hi all&lt;BR /&gt;I am working on Zigbee Mc1321x.&lt;BR /&gt;I write a string of 2 bytes on uart at eah timer interval (for example every 1 seconds).&lt;BR /&gt;How can I receive both the two bytes at zigbee node? I wrote this code:&lt;BR /&gt;&lt;BR /&gt;uint8_t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UartByte[2];&lt;BR /&gt;static void UartRxCallBack&lt;BR /&gt;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp; void&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; UartX_GetByteFromRxBuffer(&amp;amp;UartByte[0]);&lt;BR /&gt;&amp;nbsp; UartX_GetByteFromRxBuffer(&amp;amp;UartByte[1]);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; SendToNode(gZbAddrMode16Bit_c, CoordinatorNwkAddr, gApsTxOptionNone_c, UartByte);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;}&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;But It seems that the too bytes are not received at once. They are received byte by byte. So UartByte[0] takes the second byte value and UartByte[1] never takes anything (always 0x00).&lt;BR /&gt;What should I do? Can anbody give me the right code?&lt;BR /&gt;PLEASE REPLY.........&lt;SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif"&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Added p/n to subject.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-09-03&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;10:57 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2008 12:07:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problem-in-receiveing-bytes-from-uart-Zigbee-MC1321X/m-p/183250#M13524</guid>
      <dc:creator>bitasobhani</dc:creator>
      <dc:date>2008-09-02T12:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: problem in receiveing bytes from uart</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/problem-in-receiveing-bytes-from-uart-Zigbee-MC1321X/m-p/183251#M13525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;your problem is that you think that UartRxCallBack() is run when the uart has received all data.&lt;BR /&gt;But the callback is run as soon as some data (even only 1 byte) is received.&lt;BR /&gt;I suppose that the callback is run twice (first time after the first byte, second time after the second byte).&lt;BR /&gt;&lt;BR /&gt;If the callback is run, and only 1 byte is in the buffer I think that the first getbyte() get the true data, but the second get nothing (buffer empty).&lt;BR /&gt;So the second time the callback is called (when the second byte arrived) the data in UartByte[0] is overwritten with the second byte you sent.&lt;BR /&gt;&lt;BR /&gt;All this is IMHO, I never used zigbee, so I'm not sure about the behaviour of this processor, but usually the behaviour of uart is something like this.&lt;BR /&gt;&lt;BR /&gt;Bye Jack&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2008 21:16:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/problem-in-receiveing-bytes-from-uart-Zigbee-MC1321X/m-p/183251#M13525</guid>
      <dc:creator>jag</dc:creator>
      <dc:date>2008-09-03T21:16:39Z</dc:date>
    </item>
  </channel>
</rss>

