<?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: Simple SGPIO test program isn't working as expected in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577899#M19720</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Jeroen3 on Wed Oct 10 00:05:11 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Where do you execute from?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:01:27 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:01:27Z</dc:date>
    <item>
      <title>Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577894#M19715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jgorsk on Fri Oct 05 07:42:57 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying learn how to use the SGPIO, I wrote a simple test program&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and I expected to see 8 clock pulses at SGPIO9 and SGPIO13 outputs&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(OUT_MUX_CFG = 0x08).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead I'm getting serial bit patterns as specified by REG&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;register contents.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong in the following example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_RGU -&amp;gt; RESET_CTRL1 = (LPC_RGU-&amp;gt;RESET_ACTIVE_STATUS1) | (1 &amp;lt;&amp;lt; 25); // reset the SGPIO block&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; OUT_MUX_CFG[9] = 0x00000008;//SPGIO9 is clk_out&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; OUT_MUX_CFG[13] = 0x00000008;//SPGIO13 is clk_out&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; SLICE_MUX_CFG[12] = 0x00000000;//slice M&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; SLICE_MUX_CFG[14] = 0x00000000;//slice O&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; SGPIO_MUX_CFG[12] = 0x00000000;//Slice M&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; SGPIO_MUX_CFG[14] = 0x00000000;//Slice O&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; CTRL_ENABLED&amp;nbsp; &amp;amp;= ~((1 &amp;lt;&amp;lt; 12) | (1 &amp;lt;&amp;lt; 14));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; CTRL_DISABLED &amp;amp;= ~((1 &amp;lt;&amp;lt; 12) | (1 &amp;lt;&amp;lt; 14));&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; GPIO_OENREG |= (1 &amp;lt;&amp;lt; 9) | (1 &amp;lt;&amp;lt; 13); //SGPIO9 and 13 are active outputs&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; REG[12] = 0x00000050;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; REG[14] = 0xffffff0f;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; REG_SS[12] = 0xffffffff;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; REG_SS[14] = 0xffffffff;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; PRESET[12] = 16;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; PRESET[14] = 16;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; COUNT[12] = 16;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; COUNT[14] = 16;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; POS[12] = 0x00000808;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; POS[14] = 0x00000808;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; CTRL_ENABLED&amp;nbsp; |= (1 &amp;lt;&amp;lt; 12) | (1 &amp;lt;&amp;lt; 14);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC_SGPIO -&amp;gt; CTRL_DISABLED |= (1 &amp;lt;&amp;lt; 12) | (1 &amp;lt;&amp;lt; 14);&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577894#M19715</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577895#M19716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jgorsk on Fri Oct 05 09:17:59 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I found an error in the program, SGPIO13 is clk out for slice J not O. I corrected the program but I'm still not getting the clock outputs&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577895#M19716</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577896#M19717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jgorsk on Mon Oct 08 01:30:41 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I found out what the problem was. Some extra delay is needed between&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;writing to RESET_CTRL1 register (to reset SGPIO) and writing to SGPIO registers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The delay needs to be pretty long, definitely more than just a few CPU instructions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It is very strange, I know that the extra delay helps but is it really solving the problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can somebody in NXP Support explain why it works that way please? Timing may be crucial&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in SPGIO applications which often work at high speed. Any timing constraints should be &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;clearly stated in the SGPIO documentation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577896#M19717</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577897#M19718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Jeroen3 on Tue Oct 09 00:26:07 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;User Manual 13.2 table 110 describes that BASE_SAFE_CLK is used for RGU delays. Which can be slower than your core speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe you can try waiting for the RESET_ACTIVE_STATUS1 register?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577897#M19718</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577898#M19719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jgorsk on Tue Oct 09 10:54:03 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Jeroen3, that makes sense.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have another timing related problem. I'm trying to do a simple master SPI port&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;using SGPIO with just clock and data_out (MOSI) outputs. It's supposed to send &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;11 bits of data in each transmission. For the initial testing I decided to automatically &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;stop the shift registers when the transmission is finished (bits in CTRL_DISABLED register &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;corresponding to the slices used are set just after setting the corresponding bits in CTRL_ENABLED&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;register). I'm using SGPIO interrupt. Everything works but there are big gaps between consecutive &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;transmissions.&amp;nbsp; Some of that is caused by the SGPIO ISR but it looks like the interrupr is triggered &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;about 300ns after the end of a transmission. (SGPIO clock is 176MHz, SPI clock is 44MHz).I'm using &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the exchange clock interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it supposed to work that way or is it an error in my program?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577898#M19719</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577899#M19720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Jeroen3 on Wed Oct 10 00:05:11 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Where do you execute from?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577899#M19720</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577900#M19721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by jgorsk on Wed Oct 10 09:27:43 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm executing from the internal flash memory. It looks like the delays are casued by my program. I'll try to implement DMA transfers instead of using interrupts. That should solve the problem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577900#M19721</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Simple SGPIO test program isn't working as expected</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577901#M19722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Jeroen3 on Thu Oct 11 02:35:51 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You should have a Exchange interrupt in which you can load the REG_SS register for the next data. When you only load one register and incrementing a counter in the interrupt, you should be able to make it, I think.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, you've set CTRL_DISABLED so you need to manually restart the slices (since they have stopped when pos went 0). This probably causes the delay.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:01:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Simple-SGPIO-test-program-isn-t-working-as-expected/m-p/577901#M19722</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:01:29Z</dc:date>
    </item>
  </channel>
</rss>

