<?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: SPI debugging</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561404#M16306</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 Thu Aug 25 14:48:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello drat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For some general info about the SPI-bus&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;see ... &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:19:55 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:19:55Z</dc:date>
    <item>
      <title>SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561399#M16301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by drat on Wed Aug 24 19:36:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am developing SPI on the LPC17xx and I was wondering if the SSEL needs to be controlled by me or will the hardware do that?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the setup code is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SCB_PCLKSEL0 |= (1&amp;lt;&amp;lt;16);//PERIPHERAL CLOCK SELECTION FOR SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PCB_PINSEL0 |= (3&amp;lt;&amp;lt;30);&amp;nbsp; //select SCK on pin P0.15&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PCB_PINSEL1 |= 0b111111;&amp;nbsp; //select SSEL -&amp;gt; P0.16 and MISO -&amp;gt; P0.17 and MOSI -&amp;gt; P0.18&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S0SPCCR |= 8;//CLOCK DEVIDER&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S0SPCR |= (1&amp;lt;&amp;lt;3);//CPHA = 1; DATA IS SAMPLED ON THE SECOND CLOCK EDGE OF SCK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S0SPCR |= (1&amp;lt;&amp;lt;4);//CPOL = 1; CLOCK POLARITY; ACTIVE LOW&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;S0SPCR |= (1&amp;lt;&amp;lt;5);//MSTR = 1; MASTER MODE;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can anybody help me understand why SPI does not work?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561399#M16301</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561400#M16302</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 Aug 24 19:55:50 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There's an SSP sample in examples in NXP_LPCXpresso1769_MCB1700_2011-02-11.zip.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's SSP0Init could help you:&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 SSP0Init( void )
{
&amp;nbsp; uint8_t i, Dummy=Dummy;

&amp;nbsp; /* Enable AHB clock to the SSP0. */
&amp;nbsp; LPC_SC-&amp;gt;PCONP |= (0x1&amp;lt;&amp;lt;21);

&amp;nbsp; /* Further divider is needed on SSP0 clock. Using default divided by 4 */
&amp;nbsp; LPC_SC-&amp;gt;PCLKSEL1 &amp;amp;= ~(0x3&amp;lt;&amp;lt;10);

&amp;nbsp; /* P0.15~0.18 as SSP0 */
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 &amp;amp;= ~(0x3UL&amp;lt;&amp;lt;30);
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL0 |= (0x2UL&amp;lt;&amp;lt;30);
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~((0x3&amp;lt;&amp;lt;0)|(0x3&amp;lt;&amp;lt;2)|(0x3&amp;lt;&amp;lt;4));
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 |= ((0x2&amp;lt;&amp;lt;0)|(0x2&amp;lt;&amp;lt;2)|(0x2&amp;lt;&amp;lt;4));
&amp;nbsp; 
#if !USE_CS
&amp;nbsp; LPC_PINCON-&amp;gt;PINSEL1 &amp;amp;= ~(0x3&amp;lt;&amp;lt;0);
&amp;nbsp; LPC_GPIO0-&amp;gt;FIODIR |= (0x1&amp;lt;&amp;lt;16);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* P0.16 defined as GPIO and Outputs */
#endif
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; /* Set DSS data to 8-bit, Frame format SPI, CPOL = 0, CPHA = 0, and SCR is 15 */
&amp;nbsp; LPC_SSP0-&amp;gt;CR0 = 0x0707;

&amp;nbsp; /* SSPCPSR clock prescale register, master mode, minimum divisor is 0x02 */
&amp;nbsp; LPC_SSP0-&amp;gt;CPSR = 0x2;

&amp;nbsp; for ( i = 0; i &amp;lt; FIFOSIZE; i++ )
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dummy = LPC_SSP0-&amp;gt;DR;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* clear the RxFIFO */
&amp;nbsp; }

&amp;nbsp; /* Enable the SSP Interrupt */
&amp;nbsp; NVIC_EnableIRQ(SSP0_IRQn);
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; /* Device select as master, SSP Enabled */
#if LOOPBACK_MODE
&amp;nbsp; LPC_SSP0-&amp;gt;CR1 = SSPCR1_LBM | SSPCR1_SSE;
#else
#if SSP_SLAVE
&amp;nbsp; /* Slave mode */
&amp;nbsp; if ( LPC_SSP0-&amp;gt;CR1 &amp;amp; SSPCR1_SSE )
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; /* The slave bit can't be set until SSE bit is zero. */
&amp;nbsp;&amp;nbsp;&amp;nbsp; LPC_SSP0-&amp;gt;CR1 &amp;amp;= ~SSPCR1_SSE;
&amp;nbsp; }
&amp;nbsp; LPC_SSP0-&amp;gt;CR1 = SSPCR1_MS;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable slave bit first */
&amp;nbsp; LPC_SSP0-&amp;gt;CR1 |= SSPCR1_SSE;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable SSP */
#else
&amp;nbsp; /* Master mode */
&amp;nbsp; LPC_SSP0-&amp;gt;CR1 = SSPCR1_SSE;
#endif
#endif
&amp;nbsp; /* Set SSPINMS registers to enable interrupts */
&amp;nbsp; /* enable all error related interrupts */
&amp;nbsp; LPC_SSP0-&amp;gt;IMSC = SSPIMSC_RORIM | SSPIMSC_RTIM;
&amp;nbsp; return;
}
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;...SSEL needs to be controlled by me or will the hardware do that?&lt;BR /&gt;&lt;/SPAN&gt;&lt;HR /&gt;&lt;SPAN&gt;As shown in this sample you can control CS yourself (with GPIO) or let the hardware do that &lt;SPAN class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;&lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561400#M16302</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561401#M16303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Aug 25 00:25:58 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Drat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SSEL can be controlled by the SSP module but then it works as stated in the user manual. Then for each and every frame (byte/word) that you send, the SSEL becomes active and inactive in between.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why? Cause this is the 'SPI standard' although I don't know why because the SPI devices I know all have a 'chip select' that is active during a whole transaction of multiple words.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So for most of your application you are free to use any GPIO pin as SSEL/CS since that is how you want to use it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561401#M16303</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561402#M16304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by drat on Thu Aug 25 13:37:20 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Zero and rob. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My problem is when i scope the pins i do not see a clock signal or a data out signal. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the pins are configured to having internal pull ups and i was wondering if i have set up some thing wrong. also I have changed the P0.16 from being hardware controlled to being controlled by me i.e it is in gpio configuration. when i scope p0.16 i can see it jump up and down but the other pins seem like they are dead. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;any thoughts?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561402#M16304</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561403#M16305</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 Aug 25 14:09:16 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: drat&lt;/STRONG&gt;&lt;BR /&gt;My problem is when i scope the pins i do not see a clock signal or a data out signal&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#1 Are you aware that SPI means shifting bits from MOSI to slave and back to MISO ? Without writing data to your SPI data register you will see nothing :eek:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#2 Perhaps it's a good idea to use SSP instead of SPI (see sample above).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#3 Also it could be a good idea to zip and post your project :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#4 Did you check PCSPI bit in PCONP ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561403#M16305</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561404#M16306</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 Thu Aug 25 14:48:03 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello drat,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For some general info about the SPI-bus&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;see ... &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561404#M16306</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: SPI debugging</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561405#M16307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by drat on Thu Aug 25 19:20:53 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks everybody for your kind help! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I realized that the SPI line was running faster than I thought and therefore I was not scoping it right. :o&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yet again thanks for all your help guys!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:19:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/SPI-debugging/m-p/561405#M16307</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:19:56Z</dc:date>
    </item>
  </channel>
</rss>

