<?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>LPCXpresso IDEのトピックRe: How do you debug SPI?</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582591#M25504</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Mike45 on Mon Nov 08 15:50:40 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;i still get huge errors using 16 bits&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:15:04 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T01:15:04Z</dc:date>
    <item>
      <title>How do you debug SPI?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582588#M25501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Mike45 on Mon Nov 08 10:20:13 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to interface to an ADC chip - MCP3002.&amp;nbsp; I've read the data sheet many times and tried to follow the directions with no success and i don't know what to try next.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;While turning my pot seems to get me a range of values from 0 to 1023, they are extremely inaccurate.&amp;nbsp; I get better values near 0 and 1023, but other values can be off by 3 or 400.&amp;nbsp; My code simply writes a configuration byte(0x1E) and trys to do a read like this:&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;void readandwrite (void)
{

GPIOSetValue( PORT0, 2, 1 );
&amp;nbsp; /* port0, bit 2 is set to GPIO output and high */
GPIOSetValue( PORT0, 2, 0 );

SSPSend ((uint8_t *)LIST, 1); //#define LIST 0x1E

SSPReceive ((uint32_t&amp;nbsp; *)src_addr, 1);
GPIOSetValue( PORT0, 2, 1 );

printf("%i\n", src_addr[0]);

}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; The only other changes i made to the code was to output a 10 bit value and change the SCK frequency to 1007 HZ by setting LPC_SSP_&amp;gt;CPSR t0 0xFE and LPC_SSP_&amp;gt;CR0 to 0x7C09.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any suggestions on how to debug SPI would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:15:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582588#M25501</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you debug SPI?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582589#M25502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Mike45 on Mon Nov 08 12:08:45 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;I think that I am getting close, i am doing two sequential reads,&amp;nbsp; but i don't know how to process the MSB and LSB values i am getting into an integer.&amp;nbsp; [IMG]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fi52.tinypic.com%2F24pe1k5.png%5B%2FIMG%5D" rel="nofollow" target="_blank"&gt;http://i52.tinypic.com/24pe1k5.png[/IMG]&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:15:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582589#M25502</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do you debug SPI?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582590#M25503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by gbm on Mon Nov 08 12:45:45 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Why don't you set SPI word length to 16 bits?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:15:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582590#M25503</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you debug SPI?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582591#M25504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Mike45 on Mon Nov 08 15:50:40 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;i still get huge errors using 16 bits&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:15:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/How-do-you-debug-SPI/m-p/582591#M25504</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:15:04Z</dc:date>
    </item>
  </channel>
</rss>

