<?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: GPIO configuration in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373248#M19495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Amey&lt;/P&gt;&lt;P&gt;It is dependent on what you use the GPIO pin, if you use the GPIO pin to output signal, this is the procedure:&lt;/P&gt;&lt;P&gt;1)enable the GPIO module clock in the SIM_SCGC5 register, for example, enable PORTA by&amp;nbsp; setting the PORTA bit in SIM_SCGC5&lt;/P&gt;&lt;P&gt;2)configure the MUX bits in PORTx_PCRn register based on the section 10.3.1 K70 Signal Multiplexing and Pin Assignments in reference manual of k70&lt;/P&gt;&lt;P&gt;3)set the corresponding bit in GPIOx_PDDR register to enable GPIO output mode&lt;/P&gt;&lt;P&gt;4)you can set/clear the GPIO pin by writing GPIOx_PDOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you read the logic of the GPIO pin, after you enable the GPIO port clock, I think you can read the pin&amp;nbsp; directly by reading the GPIOx_PTOR register. I think&amp;nbsp; It is okay to set the GPIO pin in GPIO mode by writing the PORTx_PCRn register as above procedure, clear the bit in GPIOx_PDDR register, then read GPIOx_PDIR register to get the pin logic.&lt;/P&gt;&lt;P&gt;Have a nice festival&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Dec 2014 09:27:13 GMT</pubDate>
    <dc:creator>xiangjun_rong</dc:creator>
    <dc:date>2014-12-24T09:27:13Z</dc:date>
    <item>
      <title>GPIO configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373247#M19494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do we have to configure a pin as gpio in k70 or we can directly use GPIOx_PDDR for io?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 06:26:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373247#M19494</guid>
      <dc:creator>ameybhopi</dc:creator>
      <dc:date>2014-12-24T06:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373248#M19495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Amey&lt;/P&gt;&lt;P&gt;It is dependent on what you use the GPIO pin, if you use the GPIO pin to output signal, this is the procedure:&lt;/P&gt;&lt;P&gt;1)enable the GPIO module clock in the SIM_SCGC5 register, for example, enable PORTA by&amp;nbsp; setting the PORTA bit in SIM_SCGC5&lt;/P&gt;&lt;P&gt;2)configure the MUX bits in PORTx_PCRn register based on the section 10.3.1 K70 Signal Multiplexing and Pin Assignments in reference manual of k70&lt;/P&gt;&lt;P&gt;3)set the corresponding bit in GPIOx_PDDR register to enable GPIO output mode&lt;/P&gt;&lt;P&gt;4)you can set/clear the GPIO pin by writing GPIOx_PDOR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you read the logic of the GPIO pin, after you enable the GPIO port clock, I think you can read the pin&amp;nbsp; directly by reading the GPIOx_PTOR register. I think&amp;nbsp; It is okay to set the GPIO pin in GPIO mode by writing the PORTx_PCRn register as above procedure, clear the bit in GPIOx_PDDR register, then read GPIOx_PDIR register to get the pin logic.&lt;/P&gt;&lt;P&gt;Have a nice festival&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 09:27:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373248#M19495</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2014-12-24T09:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373249#M19496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiang I am very new to k70 microcontroller I want to make PTC4 pin as&lt;/P&gt;&lt;P&gt;input to receive digital data fron a device. I have written in this way&lt;/P&gt;&lt;P&gt;GPIOC_PDDR&amp;amp;=(1ul&amp;lt;&amp;lt;4)    and then read 4th bit USING GPIOC_PDIR&lt;/P&gt;&lt;P&gt;Is this correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Wed, Dec 24, 2014 at 2:57 PM, xiangjun.rong &amp;lt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 10:39:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373249#M19496</guid>
      <dc:creator>ameybhopi</dc:creator>
      <dc:date>2014-12-24T10:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: GPIO configuration</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373250#M19497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;according to XiangJun's direction, you should take the following procedure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(1) SIM_SCGC5&amp;nbsp; |=&amp;nbsp; (1&amp;lt;&amp;lt;11); // PORTC Clock Enable&lt;BR /&gt;(2) PORTC_PCR4 &amp;amp;= ~(7&amp;lt;&amp;lt;7);&amp;nbsp; // set PORTC4 MUX to 000 (disable)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PORTC_PCR4 |=&amp;nbsp; (1&amp;lt;&amp;lt;7);&amp;nbsp; // set PORTC4 MUX to 001 (GPIO)&lt;BR /&gt;(3) GPIOC_PDDR &amp;amp;= ~(1&amp;lt;&amp;lt;4);&amp;nbsp; // set GPIOC4 input&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you can get PTC4 input data from GPIOC_PDIR[4].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;BR /&gt;Yasuhiko Koumoto.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Dec 2014 01:59:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/GPIO-configuration/m-p/373250#M19497</guid>
      <dc:creator>yasuhikokoumoto</dc:creator>
      <dc:date>2014-12-25T01:59:03Z</dc:date>
    </item>
  </channel>
</rss>

