<?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のトピックSGPIO with External Clock does not work</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1851861#M55908</link>
    <description>&lt;P&gt;SGPIO with External Clock on LPC4330 does not work--unless I've missed something.&lt;/P&gt;&lt;P&gt;I boiled this down to the minimum:&lt;/P&gt;&lt;P&gt;SGPIO8 (slice A) is a clock source running at ~12MHz.&amp;nbsp; It uses CLK output, which is inverted.&amp;nbsp; SGPIO8 is a valid choice for external clock input to a Slice that requests external input (per documentation).&lt;/P&gt;&lt;P&gt;SGPIO1 (Slice D) is a clock source running at ~12MHz.&amp;nbsp; It uses CLK output non-inverted.&amp;nbsp; Slice D is a valid choice for external clock input to a Slice that requests external input (per documentation)&lt;/P&gt;&lt;P&gt;SGPIO5 (Slice F) is set to output CLK on SGPIO5 non-inverted.&amp;nbsp; It can select input from the COUNT register, or from external clocks (SGPIO8 and Slice D) above.&lt;/P&gt;&lt;P&gt;With Slice F configured for COUNT clock (SLICE_MUX_CFG[Slice_F] = (0 &amp;lt;&amp;lt; 3)), and with the COUNTER set to divide the same input clock by 4, we get the first picture on the output pins for all three.&amp;nbsp; This is expected.&amp;nbsp; (See attached JPG image)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, when Slice F configured to use External Clock as input (SLICE_MUX_CFG[Slice_F] = (1 &amp;lt;&amp;lt; 3)), which selects an external clock (should pick up SGPIO8) as described in the documentation, the input provides no signal.&amp;nbsp; The only change is the bit 3 of SLICE_MUX_CFG.&amp;nbsp; The output of SGPIO5 should be showing a ~12MHz signal.&amp;nbsp; (See attached JPG image)&lt;/P&gt;&l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PAN&gt;//External Clock&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_MUX_CFG&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;]= &lt;/SPAN&gt;&lt;SPAN&gt;//Slice F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SGPIO_MUXCFG_EXTCLK_ENABLE &lt;/SPAN&gt;&lt;SPAN&gt;//Enable external clock (1 for SPGIO8, possibly 0 for Slice D?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_MUXCFG_CS_PMODE_SGPIO8 &lt;/SPAN&gt;&lt;SPAN&gt;//External clock SGPIO8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_MUXCFG_CS_SMODE_SLICED &lt;/SPAN&gt;&lt;SPAN&gt;//External clock on Slice D&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_MUXCFG_QUAL_MODE_ENABLE; &lt;/SPAN&gt;&lt;SPAN&gt;//Qualifier input always enabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;GPIO_OENREG&lt;/SPAN&gt;&lt;SPAN&gt; |= (1 &amp;lt;&amp;lt; 5); &lt;/SPAN&gt;&lt;SPAN&gt;//Output Enable SGPIO5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* Go */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;CTRL_DISABLED&lt;/SPAN&gt;&lt;SPAN&gt; = ~((1 &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_A&lt;/SPAN&gt;&lt;SPAN&gt;) | (1 &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_D&lt;/SPAN&gt;&lt;SPAN&gt;) | (1 &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;)); &lt;/SPAN&gt;&lt;SPAN&gt;//Slice A, D, F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;CTRL_ENABLED&lt;/SPAN&gt;&lt;SPAN&gt; = (1 &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_A&lt;/SPAN&gt;&lt;SPAN&gt;) | (1 &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_D&lt;/SPAN&gt;&lt;SPAN&gt;) | (1 &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;SPAN&gt;//Slice A, D, F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried many variations on this test, but the results are always the same,&lt;BR /&gt;fully repeatable. The lack of external clock input is contrary to the documentation&lt;BR /&gt;but is demonstrated by this test to not work. When the external clock source is selected&lt;BR /&gt;the no clock is provided at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize that I must have missed something in the setup, but I have been over this&lt;BR /&gt;literally dozens of times, I have read every article online about SGPIO and&lt;BR /&gt;external clocks. The proof is in the simplified example. I cannot figure out a solution&lt;BR /&gt;to get an external clock to drive any SGPIO input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please look over the example in detail and tell me how to get an external&lt;BR /&gt;clock as an external clock input to and SGPIO slice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 20:37:32 GMT</pubDate>
    <dc:creator>edarring</dc:creator>
    <dc:date>2024-04-22T20:37:32Z</dc:date>
    <item>
      <title>SGPIO with External Clock does not work</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1851861#M55908</link>
      <description>&lt;P&gt;SGPIO with External Clock on LPC4330 does not work--unless I've missed something.&lt;/P&gt;&lt;P&gt;I boiled this down to the minimum:&lt;/P&gt;&lt;P&gt;SGPIO8 (slice A) is a clock source running at ~12MHz.&amp;nbsp; It uses CLK output, which is inverted.&amp;nbsp; SGPIO8 is a valid choice for external clock input to a Slice that requests external input (per documentation).&lt;/P&gt;&lt;P&gt;SGPIO1 (Slice D) is a clock source running at ~12MHz.&amp;nbsp; It uses CLK output non-inverted.&amp;nbsp; Slice D is a valid choice for external clock input to a Slice that requests external input (per documentation)&lt;/P&gt;&lt;P&gt;SGPIO5 (Slice F) is set to output CLK on SGPIO5 non-inverted.&amp;nbsp; It can select input from the COUNT register, or from external clocks (SGPIO8 and Slice D) above.&lt;/P&gt;&lt;P&gt;With Slice F configured for COUNT clock (SLICE_MUX_CFG[Slice_F] = (0 &amp;lt;&amp;lt; 3)), and with the COUNTER set to divide the same input clock by 4, we get the first picture on the output pins for all three.&amp;nbsp; This is expected.&amp;nbsp; (See attached JPG image)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, when Slice F configured to use External Clock as input (SLICE_MUX_CFG[Slice_F] = (1 &amp;lt;&amp;lt; 3)), which selects an external clock (should pick up SGPIO8) as described in the documentation, the input provides no signal.&amp;nbsp; The only change is the bit 3 of SLICE_MUX_CFG.&amp;nbsp; The output of SGPIO5 should be showing a ~12MHz signal.&amp;nbsp; (See attached JPG image)&lt;/P&gt;&lt;P&gt;Here is the actual code:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCU_PinMuxSet(1, 12, SCU_MODE_FUNC6); &lt;/SPAN&gt;&lt;SPAN&gt;//Slice A, SGPIO8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCU_PinMuxSet(0, 1, SCU_MODE_FUNC3); &lt;/SPAN&gt;&lt;SPAN&gt;//Slice D, SGPIO1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_SCU_PinMuxSet(2, 1, SCU_MODE_FUNC0); &lt;/SPAN&gt;&lt;SPAN&gt;//Slice F, SGPIO5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Chip_Clock_SetBaseClock(&lt;/SPAN&gt;&lt;SPAN&gt;CLK_BASE_PERIPH&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;CLKIN_IDIVC&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;TRUE&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;FALSE&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;/SPAN&gt;&lt;SPAN&gt;//For SGPIOs&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;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amp;lt;&amp;lt; 3); &lt;/SPAN&gt;&lt;SPAN&gt;//Slice A Invert clock output&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_MUX_CFG&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_A&lt;/SPAN&gt;&lt;SPAN&gt;]= 0; &lt;/SPAN&gt;&lt;SPAN&gt;//Defaults&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;GPIO_OENREG&lt;/SPAN&gt;&lt;SPAN&gt; |= (1 &amp;lt;&amp;lt; 8); &lt;/SPAN&gt;&lt;SPAN&gt;//Output Enable SGPIO8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/* Setup Slice D, CLKOUT */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;PRESET&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_D&lt;/SPAN&gt;&lt;SPAN&gt;]= 0; &lt;/SPAN&gt;&lt;SPAN&gt;//Set COUNT (PRESET) to count-1&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_D&lt;/SPAN&gt;&lt;SPAN&gt;] = 0; &lt;/SPAN&gt;&lt;SPAN&gt;//Initialize counter as well&lt;/SPAN&gt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&gt;&lt;SPAN&gt;/* Setup Slice F, SGPIO5 as CLKOUT using External Clock for input */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;PRESET&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;]= 3; &lt;/SPAN&gt;&lt;SPAN&gt;//Divide PERIPH rate by 4 so we can&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;COUNT&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;] = 3; &lt;/SPAN&gt;&lt;SPAN&gt;//see the difference from ExtClocks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;OUT_MUX_CFG&lt;/SPAN&gt;&lt;SPAN&gt;[5] = &lt;/SPAN&gt;&lt;SPAN&gt;//SGPIO5&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SGPIO_OUT_MUXCFG_OUTCFG_CLKOUT &lt;/SPAN&gt;&lt;SPAN&gt;//Clock out to measure&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_OUT_MUXCFG_OECFG_GPIOOE;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;SLICE_MUX_CFG&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;]= &lt;/SPAN&gt;&lt;SPAN&gt;//Slice F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;SGPIO_SLICE_MUXCFG_CLKGEN&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;//External Clock&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_MUX_CFG&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;SGPIO_SLICE_F&lt;/SPAN&gt;&lt;SPAN&gt;]= &lt;/SPAN&gt;&lt;SPAN&gt;//Slice F&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SGPIO_MUXCFG_EXTCLK_ENABLE &lt;/SPAN&gt;&lt;SPAN&gt;//Enable external clock (1 for SPGIO8, possibly 0 for Slice D?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_MUXCFG_CS_PMODE_SGPIO8 &lt;/SPAN&gt;&lt;SPAN&gt;//External clock SGPIO8&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_MUXCFG_CS_SMODE_SLICED &lt;/SPAN&gt;&lt;SPAN&gt;//External clock on Slice D&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| SGPIO_MUXCFG_QUAL_MODE_ENABLE; &lt;/SPAN&gt;&lt;SPAN&gt;//Qualifier input always enabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;LPC_SGPIO-&amp;gt;&lt;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p;nbsp;&lt;/P&gt;&lt;P&gt;I have tried many variations on this test, but the results are always the same,&lt;BR /&gt;fully repeatable. The lack of external clock input is contrary to the documentation&lt;BR /&gt;but is demonstrated by this test to not work. When the external clock source is selected&lt;BR /&gt;the no clock is provided at all.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I realize that I must have missed something in the setup, but I have been over this&lt;BR /&gt;literally dozens of times, I have read every article online about SGPIO and&lt;BR /&gt;external clocks. The proof is in the simplified example. I cannot figure out a solution&lt;BR /&gt;to get an external clock to drive any SGPIO input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please look over the example in detail and tell me how to get an external&lt;BR /&gt;clock as an external clock input to and SGPIO slice.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 20:37:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1851861#M55908</guid>
      <dc:creator>edarring</dc:creator>
      <dc:date>2024-04-22T20:37:32Z</dc:date>
    </item>
    <item>
      <title>Re: SGPIO with External Clock does not work</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1852222#M55909</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have asked AE team for the SGPIO module question.&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;XiangJun Rong&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 07:11:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1852222#M55909</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2024-04-23T07:11:10Z</dc:date>
    </item>
    <item>
      <title>Re: SGPIO with External Clock does not work</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1852590#M55911</link>
      <description>&lt;P&gt;Thank you for looking deeper into this.&amp;nbsp; To help you and them,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have additional information that may be helpful, and I have found one method to (sort of) make this work.&lt;/P&gt;&lt;P&gt;First, it is possible that SGPIO8 as a clock source, solely means that the SGPIO8 DIN pin provides an external clock outside of the SGPIO system.&amp;nbsp; Trying to generate a clock on Slice F and connect the output to SGPIO8 does not appear to work (well, it works, but it can’t be used as an external clock to another slice).&amp;nbsp; Is it possible that the SGPIO8 connection only works with a truly external signal connected to P1_12?&amp;nbsp; I cannot find documentation on how to make SGPIO8 DIN an input for another slice.&amp;nbsp; Is there any?&lt;/P&gt;&lt;P&gt;Second, I was able to make the slice clock for Slice D generate a clock that can be picked up by another slice, such as Slice A.&amp;nbsp; But it requires some special considerations:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;First, the programmer must go to the northwest-most corner of the room, stand on his/her head and chant obeisance to the programming gods.&amp;nbsp; Note that this only works in North America.&amp;nbsp; Experimentation in your location may be required.&lt;/LI&gt;&lt;LI&gt;Second, and more seriously, the clock output for Slice D can be connected to the external clock input in (say,) Slice A, but only when EXT_CLK_ENABLE in SGPIO_MUX_CFG is 0.&amp;nbsp; This is contrary to AN11275 says in 4.1.3.&amp;nbsp; The user guide provides no help.&lt;/LI&gt;&lt;LI&gt;But that is not all.&amp;nbsp; If INV_OUT_CLK in SLICE_MUX_CFG is set to 1, which inverts the clock, it fails as well.&amp;nbsp; For example, an inverted clock on Slice D causes the connection to Slice A to not work.&amp;nbsp; Why is that?&amp;nbsp; Note that after Slice D is running uninverted, and Slice A is connected, the INV_OUT_CLK on Slice D can be set to 1, inverting the clock in D, but the external clock feed in Slice A remains un-inverted!&amp;nbsp; Again, why is that?&amp;nbsp; See the attached image from the data sheet on the basic operation of one slice.&amp;nbsp; See the external clock inverter circled in red?&amp;nbsp; Where is that option?&amp;nbsp; The INV_OUT_CLK appears to be the inverter circled in blue.&lt;/LI&gt;&lt;LI&gt;Testing requires not just being on the debugger, but also testing from power up.&amp;nbsp; I found cases where the connection between Slice D and Slice A would be in place and working, but disconnecting power and powering up again generated no connection.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;There may be ways to get this to work the way I need it to—but I’m disappointed with the lack of clarity in the documentation, and the inconsistencies in SGPIO.&amp;nbsp; We selected the LPC4330 partially because of the seemingly powerful SGPIO capabilities required for our heavily streaming app.&amp;nbsp; Unfortunately, SGPIOs don’t seem to work as advertised.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2024 14:46:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/SGPIO-with-External-Clock-does-not-work/m-p/1852590#M55911</guid>
      <dc:creator>edarring</dc:creator>
      <dc:date>2024-04-23T14:46:21Z</dc:date>
    </item>
  </channel>
</rss>

