<?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: Problem initializing some GPIO pins but not others in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Problem-initializing-some-GPIO-pins-but-not-others/m-p/1298791#M11209</link>
    <description>&lt;P&gt;Hi&amp;nbsp;cmarslett,&lt;/P&gt;
&lt;P&gt;PTA4 and PTC4 are default as debug port(JTAG\SWD).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not recommended to modify the debugging port to GPIO, which will cause difficulties in debugging in the future.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PTA4 PTC4.jpg" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/148112iB31EAF82C4D52A6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="PTA4 PTC4.jpg" alt="PTA4 PTC4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&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;- 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;</description>
    <pubDate>Mon, 28 Jun 2021 02:56:54 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2021-06-28T02:56:54Z</dc:date>
    <item>
      <title>Problem initializing some GPIO pins but not others</title>
      <link>https://community.nxp.com/t5/S32K/Problem-initializing-some-GPIO-pins-but-not-others/m-p/1298516#M11203</link>
      <description>&lt;P&gt;I have taken the "Hello" sample code from the cookbook file and attempted to modify it to read 5 adjacent GPIO pins on the S32K144EVB-Q100 devkit.&lt;/P&gt;&lt;P&gt;Here is the initialization code I am using:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;WDOG_disable();&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;* Enable clocks to peripherals (PORT modules) */&lt;BR /&gt;PCC-&amp;gt; PCCn[PCC_PORTA_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT A */&lt;BR /&gt;PCC-&amp;gt; PCCn[PCC_PORTB_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT B */&lt;BR /&gt;PCC-&amp;gt; PCCn[PCC_PORTC_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT C */&lt;BR /&gt;PCC-&amp;gt; PCCn[PCC_PORTD_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT D */&lt;BR /&gt;PCC-&amp;gt; PCCn[PCC_PORTE_INDEX] = PCC_PCCn_CGC_MASK; /* Enable clock to PORT E */&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;/* Configure port E9 as GPIO input (BTN 0 [SW2] on EVB) */&lt;BR /&gt;PTE-&amp;gt;PIDR &amp;amp;= ~(1L&amp;lt;&amp;lt;9); /* Port E9: Input enable for pin 9 */&lt;BR /&gt;PTE-&amp;gt;PDDR &amp;amp;= ~(1L&amp;lt;&amp;lt;9); /* Port E9: Data Direction=input for pin 9 */&lt;BR /&gt;PORTE-&amp;gt;PCR[9] = 0x00000113L; /* Port E9: MUX = GPIO, input filter enabled, pulled up */&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;PTC-&amp;gt;PIDR &amp;amp;= ~(1L&amp;lt;&amp;lt;5 | 1L&amp;lt;&amp;lt;4); /* Port C: Input enable for pins 5 and 4 */&lt;BR /&gt;PTC-&amp;gt;PDDR &amp;amp;= ~(1L&amp;lt;&amp;lt;5 | 1L&amp;lt;&amp;lt;4); /* Port C: Data Direction=input for pins 5 and 4 */&lt;BR /&gt;/* Configure port C5 as GPIO input (BTN 0 [SW2] on EVB) */&lt;BR /&gt;PORTC-&amp;gt;PCR[5] = 0x00000113L; /* Port C5: MUX = GPIO, input filter enabled, pulled up */&lt;BR /&gt;/* Configure port C4 as GPIO input (BTN 0 [SW2] on EVB) */&lt;BR /&gt;// This register setup fails (note that pin 5's setup worked)&lt;BR /&gt;PORTC-&amp;gt;PCR[4] = 0x00000113L; /* Port C4: MUX = GPIO, input filter enabled, pulled up */&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;PTA-&amp;gt;PIDR &amp;amp;= ~(1L&amp;lt;&amp;lt;10 | 1L&amp;lt;&amp;lt;4);&lt;BR /&gt;PTA-&amp;gt;PDDR &amp;amp;= ~(1L&amp;lt;&amp;lt;10 | 1L&amp;lt;&amp;lt;4);&lt;BR /&gt;/* Configure port A10 as GPIO input (BTN 0 [SW2] on EVB) */&lt;BR /&gt;PORTA-&amp;gt;PCR[10] = 0x00000113L; /* Port A10: MUX = GPIO, input filter enabled, pulled up */&lt;BR /&gt;/* Configure port A4 as GPIO input (BTN 0 [SW2] on EVB) */&lt;BR /&gt;// This register setup fails (note that pin 10's setup worked)&lt;BR /&gt;PORTA-&amp;gt;PCR[4] = 0x00000113L; /* Port A4: MUX = GPIO, input filter enabled, pulled up */&lt;/P&gt;&lt;P&gt;The double slash comments above indicate the lines that generate bus faults (I've tried both the default -O1 and -O0 optimization levels, with no noticeable difference).&lt;/P&gt;&lt;P&gt;The lines of code I use to read the GPIO pins look like this:&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;if ((PTE-&amp;gt;PDIR &amp;amp; (1&amp;lt;&amp;lt;9)) == 0) { /* If GPIO Input is 0, DOWN pushed) */&lt;/P&gt;&lt;P&gt;I am missing something in the initialization here.&amp;nbsp; Any advice?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jun 2021 15:09:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Problem-initializing-some-GPIO-pins-but-not-others/m-p/1298516#M11203</guid>
      <dc:creator>cmarslett</dc:creator>
      <dc:date>2021-06-25T15:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem initializing some GPIO pins but not others</title>
      <link>https://community.nxp.com/t5/S32K/Problem-initializing-some-GPIO-pins-but-not-others/m-p/1298791#M11209</link>
      <description>&lt;P&gt;Hi&amp;nbsp;cmarslett,&lt;/P&gt;
&lt;P&gt;PTA4 and PTC4 are default as debug port(JTAG\SWD).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is not recommended to modify the debugging port to GPIO, which will cause difficulties in debugging in the future.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PTA4 PTC4.jpg" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/148112iB31EAF82C4D52A6C/image-size/large?v=v2&amp;amp;px=999" role="button" title="PTA4 PTC4.jpg" alt="PTA4 PTC4.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&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;- 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;</description>
      <pubDate>Mon, 28 Jun 2021 02:56:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Problem-initializing-some-GPIO-pins-but-not-others/m-p/1298791#M11209</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2021-06-28T02:56:54Z</dc:date>
    </item>
  </channel>
</rss>

