<?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 PORT Control issue on FRDM-KL46Z in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388366#M62097</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to set the PORTA1 and PORTA2 pins as communication pins for UART0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use code:&lt;/P&gt;&lt;P&gt;PORTA_PCR1 |= PORT_PCR_MUX(2);&lt;BR /&gt;PORTA_PCR2 |= PORT_PCR_MUX(3);&lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;PORTA_PCR14 |= PORT_PCR_MUX(3);&lt;BR /&gt;PORTA_PCR15 |= PORT_PCR_MUX(3);&lt;/P&gt;&lt;P&gt;The debug result is unexpected interrupt as showed on snapshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StanoR_0-1639693180211.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/165470iF11CB3835B741439/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StanoR_0-1639693180211.png" alt="StanoR_0-1639693180211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I use other than PORTA, e.g. PORTE, there is no issue.&lt;/P&gt;&lt;P&gt;Why PORTA causes issue and how to solve it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Stano.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Dec 2021 22:26:18 GMT</pubDate>
    <dc:creator>StanoR</dc:creator>
    <dc:date>2021-12-16T22:26:18Z</dc:date>
    <item>
      <title>PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388366#M62097</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to set the PORTA1 and PORTA2 pins as communication pins for UART0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use code:&lt;/P&gt;&lt;P&gt;PORTA_PCR1 |= PORT_PCR_MUX(2);&lt;BR /&gt;PORTA_PCR2 |= PORT_PCR_MUX(3);&lt;/P&gt;&lt;P&gt;or:&lt;/P&gt;&lt;P&gt;PORTA_PCR14 |= PORT_PCR_MUX(3);&lt;BR /&gt;PORTA_PCR15 |= PORT_PCR_MUX(3);&lt;/P&gt;&lt;P&gt;The debug result is unexpected interrupt as showed on snapshot:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="StanoR_0-1639693180211.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/165470iF11CB3835B741439/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StanoR_0-1639693180211.png" alt="StanoR_0-1639693180211.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When I use other than PORTA, e.g. PORTE, there is no issue.&lt;/P&gt;&lt;P&gt;Why PORTA causes issue and how to solve it?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Stano.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 22:26:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388366#M62097</guid>
      <dc:creator>StanoR</dc:creator>
      <dc:date>2021-12-16T22:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388405#M62099</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Stano,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Did you enable the clock gate of PORTA?&amp;nbsp;SIM_SCGC5[PORTA]&amp;nbsp;&lt;BR /&gt;Maybe the clock gate of PORTE was enabled somewhere.&lt;BR /&gt;For Kinetis MCU development, it is recommended to use the latest &lt;A href="https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-:MCUXPRESSO" target="_self"&gt;MCUXpresso IDE and SDK&lt;/A&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>Fri, 17 Dec 2021 01:00:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388405#M62099</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2021-12-17T01:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388706#M62101</link>
      <description>&lt;P&gt;Hi Robin,&lt;/P&gt;&lt;P&gt;yes, the clocks for PORTA are enabled. I tried many variants, but PORTA differs. Other ports function well.&lt;/P&gt;&lt;P&gt;Thank you for your recommendation, I will check it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I would like to understand the core of issue - why the write instruction to PORTA_CR differs from the same instruction for other ports in MCU. I want to know "how it works" and where is the difference.&amp;nbsp;Where it is described?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Stano.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 09:27:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388706#M62101</guid>
      <dc:creator>StanoR</dc:creator>
      <dc:date>2021-12-17T09:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388833#M62103</link>
      <description>&lt;P&gt;Do not use OR (|=) use assignment (=) when setting up the port registers.&lt;/P&gt;&lt;P&gt;This is a common mistake in NXP's examples, which usually causes no problems other than wasting a bit of processor time and/or code space.&lt;BR /&gt;&lt;BR /&gt;In your case PORTA may have something already in it and ORing in the new value causes an unexpected outcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 13:31:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388833#M62103</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2021-12-17T13:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388896#M62104</link>
      <description>&lt;P&gt;Thank you for your comment, but the OR (|=) is not problem. I tried equal (=) instead and the result is the same.&lt;/P&gt;&lt;P&gt;I tried :&lt;/P&gt;&lt;P&gt;PORTA_PCR1 = PORTA_PCR1 | 0x00000200;&lt;/P&gt;&lt;P&gt;also and result is the same - fail. It is sufficient replace "A" with "E" and all is OK.&lt;/P&gt;&lt;P&gt;When I use such command and PORT&lt;STRONG&gt;A&amp;nbsp;&lt;/STRONG&gt;is used, the issue arrives. When the other port e.g. PORT&lt;STRONG&gt;E&amp;nbsp;&lt;/STRONG&gt; used, all is OK.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use the CodeWarrior 11.1,&amp;nbsp;Build Id:181224.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 15:41:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388896#M62104</guid>
      <dc:creator>StanoR</dc:creator>
      <dc:date>2021-12-17T15:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388963#M62105</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"I use the CodeWarrior 11.1,&amp;nbsp;Build Id:181224."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is very old, is there a reason not to use the newer supported tools?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;While not likely there could be a bad definition for the KL46 PORTA in an old tool.&lt;BR /&gt;&lt;BR /&gt;Seems like we need to see more of your code.&lt;BR /&gt;The order things are done in is important.&lt;BR /&gt;Is there a default handler assigned for the UART?&lt;BR /&gt;That it is ending up in the default handler when PORTA is fiddled with doesn't necessary&amp;nbsp;mean that the problem is PORTA.&amp;nbsp; It maybe jumping to an unassigned UART vector when&amp;nbsp; enabling that feature of PORTA.&lt;BR /&gt;&lt;BR /&gt;A tedious way to find out is to assign a handler to everything and find out which one is being activated.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Also interrupts should be disabled when configuring things.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 18:58:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1388963#M62105</guid>
      <dc:creator>bobpaddock</dc:creator>
      <dc:date>2021-12-17T18:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1389077#M62112</link>
      <description>&lt;P&gt;The value of PORTA_PCR are all 0x80008000 seems strange. And please check the register value of SIM_SCGC5[PORTA].&lt;/P&gt;
&lt;P&gt;In addition you can use Processor Expert by refer to:&amp;nbsp;&lt;A href="https://mcuoneclipse.com/2012/10/14/tutorial-printf-and-hello-world-with-the-freedom-kl25z-board/" target="_self"&gt;Tutorial: printf() and “Hello World!” with the Freedom KL25Z Board&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Dec 2021 02:21:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1389077#M62112</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2021-12-19T02:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: PORT Control issue on FRDM-KL46Z</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1389084#M62113</link>
      <description>&lt;P&gt;Thank you all for suggestions.&lt;/P&gt;&lt;P&gt;Issue is solved, it was caused by stupid mistake in port clock settings.&lt;/P&gt;&lt;P&gt;Stano.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Dec 2021 09:44:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/PORT-Control-issue-on-FRDM-KL46Z/m-p/1389084#M62113</guid>
      <dc:creator>StanoR</dc:creator>
      <dc:date>2021-12-19T09:44:13Z</dc:date>
    </item>
  </channel>
</rss>

