<?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-assigning a pin using the Switch Matrix in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900923#M36179</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the best practice for re-assigning a pin via the switch matrix on the LPC802 after it has already been assigned?&amp;nbsp; For instance, if I have already assigned PIO0_8 and PIO0_9 to be the TX and RX lines for UART0 and now want to make them the SDA and SCL lines for a I2C connection, would the code look like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Enable the switch matrix&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SYSCON-&amp;gt;SYSAHBCLKCTRL0 |= (SYSCON_SYSAHBCLKCTRL0_SWM_MASK);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;SPAN style="color: #339966;"&gt;// Remove the Switch Matrix's connections to the UART&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Clear bits 15:0 in PINASSIGN0&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SWM0-&amp;gt;PINASSIGN0 &amp;amp;= ~(SWM_PINASSIGN0_U0_TXD_O_MASK | SWM_PINASSIGN0_U0_RXD_I_MASK);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// USART0 is now disconnected.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Clear bits 15:0 in PINASSIGN5&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SWM0-&amp;gt;PINASSIGN5 &amp;amp;= ~(SWM_PINASSIGN5_I2C0_SDA_IO_MASK | SWM_PINASSIGN5_I2C0_SCL_IO_MASK);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Assign SCL and SDA to PINASSIGN5 bits 15:0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// SCL is PIO0_8, so put 4 into bits 7:0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// SDA is PIO0_9, so put 0 into bits 15:8&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SWM0-&amp;gt;PINASSIGN5 |= ( (0x8UL&amp;lt;&amp;lt;SWM_PINASSIGN5_I2C0_SCL_IO_SHIFT) | &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #339966;"&gt;// SCL is PIO0_8&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (0x9UL&amp;lt;&amp;lt;SWM_PINASSIGN5_I2C0_SDA_IO_SHIFT)); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #339966;"&gt;// SDA is PIO0_9&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// I2C is now connected.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// disable the switch matrix&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SYSCON-&amp;gt;SYSAHBCLKCTRL0 &amp;amp;= ~(SYSCON_SYSAHBCLKCTRL0_SWM_MASK);&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// ---------------- End of Switch Matrix code -----------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;My concern is that by clearing the values in PINASSIGN0, am I just assigning the UART0 TX and RX lines to PIO0_0?&amp;nbsp; (the 0th pin in the GPIO)&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;thanks!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;James&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 May 2019 09:10:24 GMT</pubDate>
    <dc:creator>drsmith_yorku</dc:creator>
    <dc:date>2019-05-20T09:10:24Z</dc:date>
    <item>
      <title>Re-assigning a pin using the Switch Matrix</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900923#M36179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the best practice for re-assigning a pin via the switch matrix on the LPC802 after it has already been assigned?&amp;nbsp; For instance, if I have already assigned PIO0_8 and PIO0_9 to be the TX and RX lines for UART0 and now want to make them the SDA and SCL lines for a I2C connection, would the code look like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Enable the switch matrix&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SYSCON-&amp;gt;SYSAHBCLKCTRL0 |= (SYSCON_SYSAHBCLKCTRL0_SWM_MASK);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;SPAN style="color: #339966;"&gt;// Remove the Switch Matrix's connections to the UART&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Clear bits 15:0 in PINASSIGN0&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SWM0-&amp;gt;PINASSIGN0 &amp;amp;= ~(SWM_PINASSIGN0_U0_TXD_O_MASK | SWM_PINASSIGN0_U0_RXD_I_MASK);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// USART0 is now disconnected.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Clear bits 15:0 in PINASSIGN5&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SWM0-&amp;gt;PINASSIGN5 &amp;amp;= ~(SWM_PINASSIGN5_I2C0_SDA_IO_MASK | SWM_PINASSIGN5_I2C0_SCL_IO_MASK);&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// Assign SCL and SDA to PINASSIGN5 bits 15:0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// SCL is PIO0_8, so put 4 into bits 7:0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// SDA is PIO0_9, so put 0 into bits 15:8&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SWM0-&amp;gt;PINASSIGN5 |= ( (0x8UL&amp;lt;&amp;lt;SWM_PINASSIGN5_I2C0_SCL_IO_SHIFT) | &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="color: #339966;"&gt;// SCL is PIO0_8&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (0x9UL&amp;lt;&amp;lt;SWM_PINASSIGN5_I2C0_SDA_IO_SHIFT)); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #339966;"&gt;// SDA is PIO0_9&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// I2C is now connected.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// disable the switch matrix&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;SYSCON-&amp;gt;SYSAHBCLKCTRL0 &amp;amp;= ~(SYSCON_SYSAHBCLKCTRL0_SWM_MASK);&lt;BR /&gt;&lt;SPAN style="color: #339966;"&gt;&amp;nbsp;// ---------------- End of Switch Matrix code -----------------------------------&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;My concern is that by clearing the values in PINASSIGN0, am I just assigning the UART0 TX and RX lines to PIO0_0?&amp;nbsp; (the 0th pin in the GPIO)&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;thanks!&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;James&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2019 09:10:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900923#M36179</guid>
      <dc:creator>drsmith_yorku</dc:creator>
      <dc:date>2019-05-20T09:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re-assigning a pin using the Switch Matrix</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900924#M36180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello James,&lt;/P&gt;&lt;P&gt;" am I just assigning the UART0 TX and RX lines to PIO0_0? "&lt;/P&gt;&lt;P&gt;-&amp;gt; I think yes. So please config it to Reset value&amp;nbsp; 0xFF .&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/83408i1F92329A9AF48F81/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2019 09:03:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900924#M36180</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2019-05-21T09:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re-assigning a pin using the Switch Matrix</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900925#M36181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks!&amp;nbsp; I obviously should be reading the manual more. :-)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 May 2019 11:02:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Re-assigning-a-pin-using-the-Switch-Matrix/m-p/900925#M36181</guid>
      <dc:creator>drsmith_yorku</dc:creator>
      <dc:date>2019-05-21T11:02:32Z</dc:date>
    </item>
  </channel>
</rss>

