<?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: Using GPIO for SPI CS in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566523#M18488</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by capiman on Sat Jul 05 23:22:20 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Put CS to low (manually, not automatically by SPI peripheral)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Send one byte via SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Check if byte was sent on SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) Check if a byte was received on SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) Receive it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6) Repeat steps 2 to 5 as often as you want&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7) Put CS to high (manually, not automatically by SPI peripheral)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 23:47:07 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T23:47:07Z</dc:date>
    <item>
      <title>Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566521#M18486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Dubbie on Sat Jul 05 18:48:00 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am working with a chip that sends up to 32bit ints&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have managed to talk to it using 16bit frames like the datasheet shows. However, the datasheet specifies that the CS must be held low while the instruction to retrieve the CNTR register is issued (an 8bit intstruction) and then &lt;/SPAN&gt;&lt;STRONG&gt;kept low&lt;/STRONG&gt;&lt;SPAN&gt; while the rest of the bits come in.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get the first 8 bits because they come immediately after the read instruction is sent, but as soon as the CS goes high, the chip stops sending data. Even though I send zeros immediately after, no more data arrives.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems to me that I need to use a GPIO pin to "roll my own" CS line. My question is, I have no idea how to time this. Any suggestions are very welcome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is the datasheet. Page 8 shows the relevant diagram&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.usdigital.com%2Fassets%2Fgeneral%2FLS7366R.pdf" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.usdigital.com/assets/general/LS7366R.pdf&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also attached a screenshot from my scope for a read operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code I am using to read the register&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;Chip_SSP_Int_FlushData(LPC_SSP);
uint16_t ntx_data;
ntx_data = (0x6000); // instruction read the CNTR register 0110 0000 0000 0000
Chip_SSP_SendFrame(LPC_SSP, ntx_data);
ntx_data = (0x0000); // send nothing to keep the clock going
Chip_SSP_SendFrame(LPC_SSP, ntx_data);


uint16_t rxedData = Chip_SSP_ReceiveFrame(LPC_SSP); // get first frame
uint16_t rxedData2 = Chip_SSP_ReceiveFrame(LPC_SSP); // get second frame
&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;I am using LPCOpen with LPCXpresso on an LPC1347Xpresso dev board&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566521#M18486</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566522#M18487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Dubbie on Sat Jul 05 23:09:22 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;As an update,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For now I have added a:&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;while (Chip_SSP_GetStatus(LPC_SSP, SSP_STAT_BSY)) {}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;between each GPIO CS pin set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is blocking, but for now I guess it will have to do!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566522#M18487</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566523#M18488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by capiman on Sat Jul 05 23:22:20 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Put CS to low (manually, not automatically by SPI peripheral)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Send one byte via SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) Check if byte was sent on SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4) Check if a byte was received on SPI&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;5) Receive it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;6) Repeat steps 2 to 5 as often as you want&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;7) Put CS to high (manually, not automatically by SPI peripheral)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566523#M18488</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566524#M18489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Dubbie on Sun Jul 06 02:21:33 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks very much for your suggestions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This worked!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566524#M18489</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566525#M18490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rorrik on Wed Jul 16 08:18:47 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you elaborate on how to set CS high manually, as opposed to automatically? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566525#M18490</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566526#M18491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Dubbie on Wed Jul 16 12:24:53 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Just ignore the "official" SS line. Choose a gpio line and wire that up instead. Then you can just control that like any other gpio pin.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566526#M18491</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using GPIO for SPI CS</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566527#M18492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rorrik on Wed Jul 16 12:58:32 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;These questions might be really naive, but choose a gpio line? I'm really just having trouble sifting through this SPI example. Do you have a good resource for learning the libraries and things?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 23:47:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Using-GPIO-for-SPI-CS/m-p/566527#M18492</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T23:47:09Z</dc:date>
    </item>
  </channel>
</rss>

