<?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: Send an integer through USB in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579291#M24040</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Andrew24 on Tue May 18 14:20:15 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: igorsk&lt;/STRONG&gt;&lt;BR /&gt;How are you receiving the data and how is it corrupted?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Foe example, I'm sending packet =1234.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use "Read byte" function in labwindows CVI and&amp;nbsp; get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;210.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After reading the second byte i get 4. Offcourse, i could do (210 + (4&amp;lt;&amp;lt;8))=1234, but i think there must be a nicer way to solve this&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:37:01 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:37:01Z</dc:date>
    <item>
      <title>Send an integer through USB</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579289#M24038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Andrew24 on Tue May 18 12:27:46 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello, i'm curious is there a possibility to send a 32bit integer through USB using virtual com port? It works fine when sending chars (256 max) but i cannot pass integers to a PC..They are corrupted when i receive them. Can you suggest how can i make it work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The purpuse here is to send an array of 10 integer elements.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
unsigned int
&amp;nbsp;&amp;nbsp; packet[10]={1111,2222,3333,4444,5555,6666,7777,8888,9999,1010},
&amp;nbsp;&amp;nbsp; *DataPointer;

&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt; 
/*Code for sending data through USB*/
packet_size=sizeof(packet);
DataPointer=packet; // address of a first element of an array
LPC_USB-&amp;gt;Ctrl = ((CDC_DEP_IN &amp;amp; 0x0F) &amp;lt;&amp;lt; 2) | CTRL_WR_EN;
/* 3 cycles delay*/
 delay( 5 );
LPC_USB-&amp;gt;TxPLen =packet_siz; //number of bytes to send
&amp;nbsp;&amp;nbsp; while((LPC_USB-&amp;gt;TxPLen)&amp;gt;0)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp; /*value at address ...*/
&amp;nbsp;&amp;nbsp; LPC_USB-&amp;gt;TxData = *DataPointer;
&amp;nbsp;&amp;nbsp; DataPointer++; // next array element
&amp;nbsp;&amp;nbsp; }
LPC_USB-&amp;gt;Ctrl = 0;
WrCmdEP(CDC_DEP_IN, CMD_VALID_BUF);&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:36:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579289#M24038</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Send an integer through USB</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579290#M24039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by igorsk on Tue May 18 13:51:45 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;How are you receiving the data and how is it corrupted?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579290#M24039</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Send an integer through USB</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579291#M24040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Andrew24 on Tue May 18 14:20:15 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: igorsk&lt;/STRONG&gt;&lt;BR /&gt;How are you receiving the data and how is it corrupted?&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Foe example, I'm sending packet =1234.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use "Read byte" function in labwindows CVI and&amp;nbsp; get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;210.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After reading the second byte i get 4. Offcourse, i could do (210 + (4&amp;lt;&amp;lt;8))=1234, but i think there must be a nicer way to solve this&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579291#M24040</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:37:01Z</dc:date>
    </item>
    <item>
      <title>Re: Send an integer through USB</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579292#M24041</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by igorsk on Tue May 18 17:37:53 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no idea what's "labwindows" but if it doesn't have a "read int" function (and I don't expect it would, since serial is a byte-oriented protocol), you'll just have to do it the hard way.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:37:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Send-an-integer-through-USB/m-p/579292#M24041</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:37:01Z</dc:date>
    </item>
  </channel>
</rss>

