<?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: Spi  + lpc1343 in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535458#M4623</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bobi-one on Thu Apr 28 00:58:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Zero, Thanks for the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Most of the time I search for solutions in google, but this time i am trying to&amp;nbsp; understand it from scratch.&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; src_addr[0] = 0xD0;// x
dest_addr[0]=0;
dest_addr[1]=0;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSP_Send( (uint8_t *)src_addr, 1 );
&amp;nbsp;&amp;nbsp; SSP_Receive( (uint8_t *)dest_addr, 2 );


[COLOR=Red]*x=(((dest_addr[0]&amp;lt;&amp;lt;5)|(dest_addr[1]&amp;gt;&amp;gt;3)));[/COLOR]
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;The last line is&amp;nbsp; the one&amp;nbsp; I am having doubts is it working properly in both modes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 21:47:13 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T21:47:13Z</dc:date>
    <item>
      <title>Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535454#M4619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bobi-one on Wed Apr 27 14:05:19 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am interfacing my touch screen controller via SPI but apparently I am not doing it the right way. I've managed to send words&amp;nbsp; and get the response but the way i have the response is bothering me. The touch controller is able to send 8 or 12bit responses.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can someone suggest a way to catch the incomming data into one 16bit variable. (I think i need to catch 2 bytes ) &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Don't judge me, I am often confusing myself when using&amp;nbsp; pointers + arrays :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535454#M4619</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535455#M4620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by NXP_Europe on Wed Apr 27 14:30:46 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello bobi-one,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;did you look at the 'Microwire frame format' ... see User Manual UM10375 chapter SSP.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The 'SI-format' is adjustable. The 'SO-format' is 8 bits.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535455#M4620</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535456#M4621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Wed Apr 27 14:46:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: bobi-one&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Don't judge me, I am often confusing myself when using&amp;nbsp; pointers + arrays :)&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;bobi-one,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do not feel like you are the only one confused when using pointers, arrays, and let's add structures to the list.&amp;nbsp; These are the most common to have difficulty with and are the biggest pitfalls when using C.&amp;nbsp; Maybe we should all switch to ADA.:)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Larry&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535456#M4621</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535457#M4622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Wed Apr 27 15:56:35 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;A little support from Bangalore :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1768 &amp;amp; ADS7846 Sample Code Download:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://coineltech.com/shop/product_info.php/products_id/33&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535457#M4622</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535458#M4623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bobi-one on Thu Apr 28 00:58:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Zero, Thanks for the code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Most of the time I search for solutions in google, but this time i am trying to&amp;nbsp; understand it from scratch.&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; src_addr[0] = 0xD0;// x
dest_addr[0]=0;
dest_addr[1]=0;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SSP_Send( (uint8_t *)src_addr, 1 );
&amp;nbsp;&amp;nbsp; SSP_Receive( (uint8_t *)dest_addr, 2 );


[COLOR=Red]*x=(((dest_addr[0]&amp;lt;&amp;lt;5)|(dest_addr[1]&amp;gt;&amp;gt;3)));[/COLOR]
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;The last line is&amp;nbsp; the one&amp;nbsp; I am having doubts is it working properly in both modes.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535458#M4623</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535459#M4624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Apr 28 01:08:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: bobi-one&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [COLOR=Red]*x=((dest_addr[0]&amp;lt;&amp;lt;5)|(dest_addr[1]&amp;gt;&amp;gt;3));[/COLOR]&lt;BR /&gt;&lt;BR /&gt;The last line is&amp;nbsp; the one&amp;nbsp; I am having doubts is it working properly in both modes.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should work if x is a pointer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535459#M4624</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535460#M4625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bobi-one on Thu Apr 28 06:15:14 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void SSP_Receive( uint8_t *buf, uint32_t Length )
{
&amp;nbsp; uint32_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; Length; i++ )
&amp;nbsp; {

[COLOR=Orange]LPC_SSP-&amp;gt;DR = 0x00;[/COLOR] // MDC // Wait until the Busy bit is cleared */
while ( (LPC_SSP-&amp;gt;SR &amp;amp; (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );
//while ( !(LPC_SSP-&amp;gt;SR &amp;amp; SSPSR_RNE) );
*buf = LPC_SSP-&amp;gt;DR;
buf++;

&amp;nbsp; }
&amp;nbsp; return;
}

void SSP_Receive2( uint8_t *buf, uint32_t Length )
{
&amp;nbsp; uint32_t i;

&amp;nbsp; for ( i = 0; i &amp;lt; Length; i++ )
&amp;nbsp; {

[COLOR=Red]LPC_SSP-&amp;gt;DR = 0xFF;[/COLOR] // MDC // Wait until the Busy bit is cleared */
while ( (LPC_SSP-&amp;gt;SR &amp;amp; (SSPSR_BSY|SSPSR_RNE)) != SSPSR_RNE );
//while ( !(LPC_SSP-&amp;gt;SR &amp;amp; SSPSR_RNE) );
*buf = LPC_SSP-&amp;gt;DR;
buf++;

&amp;nbsp; }
&amp;nbsp; return;
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The second receive is used for my sd card ( it worked this way), Which of the two must i use and modify something other in my code/configuration in order to use&amp;nbsp; only one function properly. (and do i need some pull up / pull down resistor for MISO in the scenario when the lpc link is not connected?)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535460#M4625</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:15Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535461#M4626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Ex-Zero on Thu Apr 28 09:46:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Since SPI is shifting data from master (via MOSI) through slave back to master (via MISO) again, your marked line is just writing to SPI data register and therefore initiating this process.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Usually this is done with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT] LPC_SSP-&amp;gt;DR = 0xFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]but other values should work also.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;MISO and MOSI don't need pull-ups.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535461#M4626</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535462#M4627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by larryvc on Thu Apr 28 12:44:13 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: bobi-one&lt;/STRONG&gt;&lt;BR /&gt;The second receive is used for my sd card ( it worked this way), Which of the two must i use and modify something other in my code/configuration in order to use&amp;nbsp; only one function properly.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you asking if you can just have one receive() routine?&amp;nbsp; If so, pass a value to assign to LPC_SSP-&amp;gt;DR. Like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;void SSP_Receive( uint8_t *buf, uint32_t Length, uint8_t value)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP-&amp;gt;DR = value;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535462#M4627</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Spi  + lpc1343</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535463#M4628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bobi-one on Fri Apr 29 11:24:49 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: larryvc&lt;/STRONG&gt;&lt;BR /&gt;Are you asking if you can just have one receive() routine?&amp;nbsp; If so, pass a value to assign to LPC_SSP-&amp;gt;DR. Like this:&lt;BR /&gt; &lt;BR /&gt;void SSP_Receive( uint8_t *buf, uint32_t Length, uint8_t value)&lt;BR /&gt; &lt;BR /&gt;LPC_SSP-&amp;gt;DR = value;&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt; Yes this is always an&amp;nbsp; option&amp;nbsp; :) , but I am trying&amp;nbsp; to understand&amp;nbsp; the problem in debt. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;After transferring this code which was running fine on the lpcxpresso&amp;nbsp; on the Miniscule board the only working SPI peripheral was the sd card&amp;nbsp; and no touch&amp;nbsp; data (without modifying the&amp;nbsp; code&amp;nbsp; ) and&amp;nbsp; noticed, when touching with finger the MOSI track, touch data was pouring in . Thats why I&amp;nbsp; soldered&amp;nbsp; pull down resistor to it, till I find why the board is making this monkey business.(When lpc link is attached is working fine without the resistor)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And now I realized: never start writing long long code, if you don't know the basics ":D&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 21:47:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Spi-lpc1343/m-p/535463#M4628</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T21:47:17Z</dc:date>
    </item>
  </channel>
</rss>

