<?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: KL02 Port A No Control in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505370#M31704</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my gpio_init function...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void gpio_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable clock for gpio ports a and b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK + SIM_SCGC5_PORTB_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // select gpio as pin functionality&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR1 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // unused&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR2 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // adc_pdrst_n&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR5 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // unused&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PCR6 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // adc_drdy_n/spi_0_miso&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // configure port b pins and clear output states of port b pins&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PDDR |= gpio_PTB_PDRST_N + gpio_PTB_1_UNUSED + gpio_PTB_5_UNUSED;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCOR |= gpio_PTB_PDRST_N + gpio_PTB_1_UNUSED + gpio_PTB_5_UNUSED;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // testing...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR2 |= PORT_PCR_IRQC(PIN_IRQC_8); -- this works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PCR6 |= PORT_PCR_IRQC(PIN_IRQC_8); -- this does NOT! Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // configure port a pins&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PDDR |= gpio_PTA_DRDY_N + gpio_PTA_5_UNUSED + gpio_PTA_7_UNUSED;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PCOR |= gpio_PTA_5_UNUSED + gpio_PTA_7_UNUSED;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 11 Feb 2016 19:13:33 GMT</pubDate>
    <dc:creator>brianpetty</dc:creator>
    <dc:date>2016-02-11T19:13:33Z</dc:date>
    <item>
      <title>KL02 Port A No Control</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505369#M31703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am new the Kinetis world and I am having a head scratching problem. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot seem to gain total control over the Port Control Registers for port A. I was having a problem setting the appropriate mux setting on individual pins then I learned I needed to enable the gate to clock the port which I did and that allowed me to set the mux functions on the pins. However, I also attempted to set the IRQC in the port control register (for some pin in port A) and will not work. Never sets the IRQC value. But the same construct works on any port B pin. I set the IRQC and the interrupt if enable is serviced. I check the SIM regs and both port A and B clocks are enabled. What is causing port A not to work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have scanned the documentation several times with nothing pointing me to a smoking gun.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help, seems like something simple but I cannot find it!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;B-rian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 14:44:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505369#M31703</guid>
      <dc:creator>brianpetty</dc:creator>
      <dc:date>2016-02-11T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: KL02 Port A No Control</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505370#M31704</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is my gpio_init function...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void gpio_init(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // enable clock for gpio ports a and b&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK + SIM_SCGC5_PORTB_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // select gpio as pin functionality&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR1 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // unused&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR2 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // adc_pdrst_n&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR5 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // unused&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PCR6 |= PORT_PCR_MUX(PIN_FUNC_ALT1);&amp;nbsp;&amp;nbsp;&amp;nbsp; // adc_drdy_n/spi_0_miso&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // configure port b pins and clear output states of port b pins&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PDDR |= gpio_PTB_PDRST_N + gpio_PTB_1_UNUSED + gpio_PTB_5_UNUSED;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCOR |= gpio_PTB_PDRST_N + gpio_PTB_1_UNUSED + gpio_PTB_5_UNUSED;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // testing...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTB_PCR2 |= PORT_PCR_IRQC(PIN_IRQC_8); -- this works...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PCR6 |= PORT_PCR_IRQC(PIN_IRQC_8); -- this does NOT! Why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // configure port a pins&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PDDR |= gpio_PTA_DRDY_N + gpio_PTA_5_UNUSED + gpio_PTA_7_UNUSED;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gpio_PTA_PCOR |= gpio_PTA_5_UNUSED + gpio_PTA_7_UNUSED;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 19:13:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505370#M31704</guid>
      <dc:creator>brianpetty</dc:creator>
      <dc:date>2016-02-11T19:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: KL02 Port A No Control</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505371#M31705</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Brian Petty:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some bits of the Port Control Register are read only if the pin does not support the corresponding feature. For example see the note for &lt;STRONG&gt;IRQC&lt;/STRONG&gt; in the Reference Manual:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/36918i725A1DAAF68C1767/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_0.png" alt="pastedImage_0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in the chapter &lt;STRONG&gt;Port Control and interrupt summary&lt;/STRONG&gt; you can find this table:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/37008iB23DCFA413FA8F3B/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see how &lt;STRONG&gt;PTA6&lt;/STRONG&gt; is not one of the pins supporting interrupts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps to clarify.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best Regards!&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Feb 2016 20:45:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KL02-Port-A-No-Control/m-p/505371#M31705</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2016-02-11T20:45:39Z</dc:date>
    </item>
  </channel>
</rss>

