<?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のトピックLPC1768</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768/m-p/1269348#M44809</link>
    <description>Hello, I am new to LPC Microcontrollers and I want to write '1' to a particular Pin on LPC1768 that performs the function of SCK(Serial Clock). My question is, Do I need to always use PINSEL to select the pin before I use FIODIR and set the Pin. Also what are difference between the statements below: LPC_PINCON-&amp;gt;FIODIR |= (1&amp;lt;&amp;lt;15); LPC_GPIO0-&amp;gt;FIODIR |= (1&amp;lt;&amp;lt;15); LPC_GPIO0-&amp;gt;FIODIR |= ((1&amp;lt;&amp;lt;15) | (1&amp;lt;&amp;lt;16)); LPC_GPIO2-&amp;gt;FIODIR &amp;amp;= ~((1&amp;lt;&amp;lt;15) | (1&amp;lt;&amp;lt;16)); Thank you.</description>
    <pubDate>Wed, 28 Apr 2021 05:58:58 GMT</pubDate>
    <dc:creator>ssr123</dc:creator>
    <dc:date>2021-04-28T05:58:58Z</dc:date>
    <item>
      <title>LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768/m-p/1269348#M44809</link>
      <description>Hello, I am new to LPC Microcontrollers and I want to write '1' to a particular Pin on LPC1768 that performs the function of SCK(Serial Clock). My question is, Do I need to always use PINSEL to select the pin before I use FIODIR and set the Pin. Also what are difference between the statements below: LPC_PINCON-&amp;gt;FIODIR |= (1&amp;lt;&amp;lt;15); LPC_GPIO0-&amp;gt;FIODIR |= (1&amp;lt;&amp;lt;15); LPC_GPIO0-&amp;gt;FIODIR |= ((1&amp;lt;&amp;lt;15) | (1&amp;lt;&amp;lt;16)); LPC_GPIO2-&amp;gt;FIODIR &amp;amp;= ~((1&amp;lt;&amp;lt;15) | (1&amp;lt;&amp;lt;16)); Thank you.</description>
      <pubDate>Wed, 28 Apr 2021 05:58:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768/m-p/1269348#M44809</guid>
      <dc:creator>ssr123</dc:creator>
      <dc:date>2021-04-28T05:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: LPC1768</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768/m-p/1269440#M44812</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think the line LPC_PINCON-&amp;gt;FIODIR |= (1&amp;lt;&amp;lt;15); is incorrect.&lt;/P&gt;
&lt;P&gt;The line LPC_GPIO0-&amp;gt;FIODIR |= (1&amp;lt;&amp;lt;15); is correct, in other words, the FIODIR&amp;nbsp; register is only belongs to GPIO module rather than IOCON.&lt;/P&gt;
&lt;P&gt;For IOCON module, pls use the PINSEL[reg] to select the pin function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;void Chip_IOCON_PinMuxSet(LPC_IOCON_T *pIOCON, uint8_t port, uint8_t pin, uint32_t modefunc)&lt;BR /&gt;{&lt;BR /&gt;Chip_IOCON_PinMux(pIOCON, port, pin, &lt;BR /&gt;/* mode is in bits 3:2 */&lt;BR /&gt;modefunc &amp;gt;&amp;gt; 2, &lt;BR /&gt;/* func is in bits 1:0 */&lt;BR /&gt;modefunc &amp;amp; 3 );&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;/* Setup pin modes and function */&lt;BR /&gt;void Chip_IOCON_PinMux(LPC_IOCON_T *pIOCON, uint8_t port, uint8_t pin, uint32_t mode, uint8_t func)&lt;BR /&gt;{&lt;BR /&gt;uint8_t reg, bitPos;&lt;BR /&gt;uint32_t temp;&lt;/P&gt;
&lt;P&gt;bitPos = IOCON_BIT_INDEX(pin);&lt;BR /&gt;reg = IOCON_REG_INDEX(port,pin);&lt;BR /&gt;&lt;BR /&gt;temp = pIOCON-&amp;gt;PINSEL[reg] &amp;amp; ~(0x03UL &amp;lt;&amp;lt; bitPos);&lt;BR /&gt;pIOCON-&amp;gt;PINSEL[reg] = temp | (func &amp;lt;&amp;lt; bitPos);&lt;/P&gt;
&lt;P&gt;temp = pIOCON-&amp;gt;PINMODE[reg] &amp;amp; ~(0x03UL &amp;lt;&amp;lt; bitPos);&lt;BR /&gt;pIOCON-&amp;gt;PINMODE[reg] = temp | (mode &amp;lt;&amp;lt; bitPos);&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pin mux block:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xiangjun_rong_0-1619593997486.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/143506iFAC165E9A653A837/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xiangjun_rong_0-1619593997486.png" alt="xiangjun_rong_0-1619593997486.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope it can help you&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;
&lt;P&gt;Xiangjun Rong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 07:13:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC1768/m-p/1269440#M44812</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2021-04-28T07:13:54Z</dc:date>
    </item>
  </channel>
</rss>

