<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/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/"><channel><title>sending a long with uart</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/20145/sending-a-long-with-uart</link><description> 
xdata unsigned long var_long _at_ 0x0150;

unsigned char * pointer;

pointer=0x0150;
var_long=0x45213256;

SBUF=*pointer;
...
SBUF=*(pointer+1);
...
SBUF=*(pointer+2);
...
SBUF=*(pointer+3);
...

 

 
my uart communication work, when i send datas byte</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/138376?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2007 04:14:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8e3128f9-4626-44ee-bade-14b43d10ec51</guid><dc:creator>Jonny Doin</dc:creator><description>&lt;p&gt;&lt;p&gt;
Right you are, thank you. I stand corrected :)&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/134925?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2007 00:55:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d0ac27f1-44d2-4f71-8316-b539ea15dcda</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
To be pedantic, that&amp;#39;s &lt;i&gt;post-&lt;/i&gt;increment - not
&lt;i&gt;auto-&lt;/i&gt;increment&lt;/p&gt;

&lt;p&gt;
If the underlying architecture has an &lt;i&gt;auto-&lt;/i&gt;increment
facility, the compiler might use it to implement the
&lt;i&gt;post-&lt;/i&gt;increment...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/123660?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 20:06:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b76708f4-1203-4472-a091-71b2af5a5de9</guid><dc:creator>Jonny Doin</dc:creator><description>&lt;p&gt;&lt;p&gt;
like&lt;/p&gt;

&lt;pre&gt;
pointer = (unsigned char *) &amp;amp;longvar;
...
SBUF = *pointer++; // msb (assumes big-endianness)
...
SBUF = *pointer++; // 2sb
...
SBUF = *pointer++; // 3sb
...
SBUF = *pointer++; // lsb
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/112660?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 20:02:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1245e3dd-87ba-4262-b4d5-49d7fdb8b7a2</guid><dc:creator>Jonny Doin</dc:creator><description>&lt;p&gt;&lt;p&gt;
like: pointer[0], pointer[1], pointer[2], pointer[3]&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/98921?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 08:28:10 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a626f1fc-7e74-4c42-a8fe-69f058409abe</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;Or just get rid of the &amp;quot;magic numbers&amp;quot; altogether ...&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
But then it wouldn&amp;#39;t be nearly so magic when (if) it works and
what&amp;#39;s the fun in that?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/112652?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 08:04:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0953ddb8-8bda-4e75-89ab-e7f70acb63d2</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Which is portable, and &lt;i&gt;may&lt;/i&gt; be no less efficient...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/98916?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 08:03:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:666d8822-63ab-497b-b7f6-4882553a3672</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
which is the alternative non-portable approach&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/88175?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 08:02:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7bd59104-cd12-47db-95ce-22e514756175</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Or just get rid of the &amp;quot;magic numbers&amp;quot; altogether and let the
compiler do it for you:&lt;/p&gt;

&lt;pre&gt;
pointer = &amp;amp;var_long;
&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
that way you &lt;i&gt;know&lt;/i&gt; it&amp;#39;ll be right!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/47791?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 07:18:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cde9daa9-0405-4a24-9fd8-180921e6ac8c</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
You are assigning an integer to a generic pointer. I think you
either need to make the pointer mspace specific or assign it
thusly:&lt;/p&gt;

&lt;pre&gt;
pointer = (unsigned char xdata *)0x0150;
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/98918?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 05:00:30 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:87aae03f-49db-4c53-adbe-5b90db3f0900</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;in this form other device can&amp;#39;t get anything&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
You have two possibilities:&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;1.&lt;/b&gt; Your code didn&amp;#39;t send anything;&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;2.&lt;/b&gt; Your code did send something, but the other device
didn&amp;#39;t receive it.&lt;/p&gt;

&lt;p&gt;
Only you can answer that!&lt;/p&gt;

&lt;p&gt;
Are you sure that your other device can cope with receiving bytes
so close together?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/74820?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 03:48:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:81162061-5739-45b6-9e11-ab5063e25722</guid><dc:creator>zeyn albul</dc:creator><description>&lt;p&gt;&lt;p&gt;
you&amp;#39;r right, my question wasn&amp;#39;t clear;&lt;/p&gt;

&lt;pre&gt;
SBUF=0x12;
...
SBUF=0x45
...
SBUF=0x63;
...
SBUF=0x24;

&lt;/pre&gt;

&lt;p&gt;
&lt;br /&gt;
(... = while(TI==0); TI=0;)&lt;/p&gt;

&lt;p&gt;
when i send datas byte one byte, i can get this bytes at other
device. but i try to send a byte which at specific adress. (in this
form other device can&amp;#39;t get anything)&lt;/p&gt;

&lt;p&gt;
xdata unsigned long long_data _at_ 0x0010;&lt;/p&gt;

&lt;p&gt;
long_data=0x45256541;&lt;/p&gt;

&lt;p&gt;
0x0010 : 0x45&lt;br /&gt;
0x0011 : 0x25&lt;br /&gt;
0x0012 : 0x65&lt;br /&gt;
0x0013 : 0x41&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sending a long with uart</title><link>https://community.arm.com/thread/47793?ContentTypeID=1</link><pubDate>Tue, 13 Feb 2007 03:15:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bbc58f81-79ab-40ab-82b5-c6fa771a3d7b</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;uart com. dont work&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
What do you mean by &amp;quot;don&amp;#39;t work&amp;quot;?&lt;/p&gt;

&lt;p&gt;
Does it not transmit anything at all?&lt;/p&gt;

&lt;p&gt;
Does it transmit something, but just not the expected data? - if
so, what &lt;i&gt;does&lt;/i&gt; it transmit?&lt;/p&gt;

&lt;p&gt;
Have you single-stepped this in the simulator?&lt;/p&gt;

&lt;p&gt;
How do you know that it&amp;#39;s your UART comms that &amp;quot;don&amp;#39;t work&amp;quot; rather
than whatever is receiving the data?&lt;/p&gt;

&lt;p&gt;
Are you correctly waiting for the transmittion of one byte to
complete before loading the next into SBUF?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>