<?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>LPC MicrocontrollersのトピックRe: SSP</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526265#M8898</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YES! Thank you!&lt;/P&gt;&lt;P&gt;I searched two days for this (although it being for a lpc11u24).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Apr 2017 14:56:10 GMT</pubDate>
    <dc:creator>rikje888</dc:creator>
    <dc:date>2017-04-13T14:56:10Z</dc:date>
    <item>
      <title>SSP</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526263#M8896</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Mon Sep 17 14:55:42 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using an LPC1226 and have ported SSP code over from a 1754 part where I have it talking to the same SPI part (a FLASH) with no problem.&amp;nbsp; I double-checked that I update the register names correctly, but maybe I missed something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm seeing here is when I send data, wait for the response, and then read the DR it always reads zero.&amp;nbsp; I checked the pins with a logic analyzer and the part is responding properly with non-zero data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I slowed the clock down to less than 1MHz and while the part happily returned data, the DR is still zero.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_14 = 2; // SPI_CLK special function output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_16 = 0b10010; // SPI_MISO special function input with pullup&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_IOCON-&amp;gt;PIO0_17 = 2; // SPI_MOSI special function output&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SYSCON-&amp;gt;SYSAHBCLKCTRL |= 1&amp;lt;&amp;lt;11; // turn on clock&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SYSCON-&amp;gt;SSPCLKDIV = 1; // set SSP_PCLK to SystemCoreClock / 1 = 24MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP-&amp;gt;CR0 =0x0007; // SPI mode 0,0, 8 bit data, Serial Clock Rate = SSP_PCLK / 1 = 24MHz&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP-&amp;gt;CPSR = 2; // SPI bit clock is SSP_PCLK / 2 = 12MHz (Flash can handle 33 in slow mode)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP-&amp;gt;CR1 = 0b10; // enable SSP (should be last register written)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;char SPI(char c) {&amp;nbsp; // send a byte and return the result&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SSP-&amp;gt;DR = c; // send byte to FIFO&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while(!(LPC_SSP-&amp;gt;SR &amp;amp; 4)); // wait until something in the receive FIFO&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;return (uint8_t)LPC_SSP-&amp;gt;DR; // return the result&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:02:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526263#M8896</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: SSP</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526264#M8897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jdurand on Mon Sep 17 15:43:09 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Found it!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reserved bit 7 MUST be high on this pin.&amp;nbsp; Apparently the pin hardware on the chip has an analog mode even though this pin has no analog functions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:02:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526264#M8897</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: SSP</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526265#M8898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YES! Thank you!&lt;/P&gt;&lt;P&gt;I searched two days for this (although it being for a lpc11u24).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Apr 2017 14:56:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SSP/m-p/526265#M8898</guid>
      <dc:creator>rikje888</dc:creator>
      <dc:date>2017-04-13T14:56:10Z</dc:date>
    </item>
  </channel>
</rss>

