<?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: FRDM-KE06Z Change KBI Example Port in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936620#M54223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare with the KBI solution in the uTasker project (free open source below) which also simulates the KBI so that there are no secrets or problems when developing.&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    INTERRUPT_SETUP interrupt_setup&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                                     &lt;SPAN class="comment token"&gt;// interrupt configuration parameters&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_type       &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KEYBOARD_INTERRUPT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// define keyboard interrupt rather than IRQ&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_priority   &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PRIORITY_KEYBOARD_INT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;              &lt;SPAN class="comment token"&gt;// interrupt priority level&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port       &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KE_PORTH&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                           &lt;SPAN class="comment token"&gt;// the port that the interrupt input is on (KE_PORTE, KE_PORTF, KE_PORTG and KE_PORTH are the same)&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits  &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTH_BIT3 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT4 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT5 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT6 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT7&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// the IRQs inputs connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_sense &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IRQ_FALLING_EDGE &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; PULLUP_ON&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;     &lt;SPAN class="comment token"&gt;// interrupt is to be falling edge sensitive&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will generate the interrupt on any falling edge on PTH3, PTH4, PTH5, PTH6 or PTH7 [note that these are on KBI1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The source causing the interrupt is visible in KBI1_SP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add PTC inputs the following can be called as well (or in place of)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KE_PORTC&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                                 &lt;SPAN class="comment token"&gt;// the port that the interrupt input is on (KE_PORTE, KE_PORTF, KE_PORTG and KE_PORTH are the same)&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT5 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT6 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT7&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// the IRQs inputs connected&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These PTCx inputs happen to be on KBI0 but the HAL automates all the internal details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By doing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KE_PORTC&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                                 &lt;SPAN class="comment token"&gt;// the port that the interrupt input is on (KE_PORTE, KE_PORTF, KE_PORTG and KE_PORTH are the same)&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT0&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                     &lt;SPAN class="comment token"&gt;// the IRQs input connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_PTC0_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                     &lt;SPAN class="comment token"&gt;// the IRQs input connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_PTC3_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT7&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                     &lt;SPAN class="comment token"&gt;// the IRQs input connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_PTC7_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each of the possible interrupts then has its own interrupt callback so that each input can directly have its own unique code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beware that the KBI controller only allows one interrupt to be recognised at a time. A second will only be recognised when the first has been removed - that means that it can't be used when more that one interrupt is in the triggering state (this is a potential restriction in using the KBI for some practical applications).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;i.MX RT project compatibility: &lt;A href="http://www.utasker.com/iMX.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/iMX.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Kinetis KE:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE02Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE02Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE02Z40M.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE02Z40M.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE04Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE04Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE06Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE06Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE15Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE15Z.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/512558" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://community.nxp.com/thread/512558&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/352862" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://community.nxp.com/thread/352862&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/498809" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://community.nxp.com/thread/498809&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Oct 2019 19:56:59 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2019-10-17T19:56:59Z</dc:date>
    <item>
      <title>FRDM-KE06Z Change KBI Example Port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936619#M54222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have loaded the KBI example in MCUXpresso 11 for the Freedom Board KE06Z. However, it doesn't seem to work&amp;nbsp;with the onboard switches on PTH3 and PTH4, butmaybe actually connected to H0?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to switch this over to using PTC0-7 and am unsure how to do that.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried changing the port in&amp;nbsp;#define EXAMPLE_KBI_SIGNAL_INPUT_REF_GPIO kGPIO_PORTH to&lt;BR /&gt;#define EXAMPLE_KBI_SIGNAL_INPUT_REF_GPIO kGPIO_PORTC but this doesn't work.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How do I switch from using port H to using all ports on PTC?&lt;BR /&gt;I'll also need to check to see which port triggered the interrupt.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 16:04:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936619#M54222</guid>
      <dc:creator>stevenlutz</dc:creator>
      <dc:date>2019-10-17T16:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KE06Z Change KBI Example Port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936620#M54223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Compare with the KBI solution in the uTasker project (free open source below) which also simulates the KBI so that there are no secrets or problems when developing.&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    INTERRUPT_SETUP interrupt_setup&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                                     &lt;SPAN class="comment token"&gt;// interrupt configuration parameters&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_type       &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KEYBOARD_INTERRUPT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// define keyboard interrupt rather than IRQ&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_priority   &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; PRIORITY_KEYBOARD_INT&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;              &lt;SPAN class="comment token"&gt;// interrupt priority level&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port       &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KE_PORTH&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                           &lt;SPAN class="comment token"&gt;// the port that the interrupt input is on (KE_PORTE, KE_PORTF, KE_PORTG and KE_PORTH are the same)&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits  &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTH_BIT3 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT4 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT5 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT6 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTH_BIT7&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// the IRQs inputs connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_sense &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;IRQ_FALLING_EDGE &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; PULLUP_ON&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;     &lt;SPAN class="comment token"&gt;// interrupt is to be falling edge sensitive&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will generate the interrupt on any falling edge on PTH3, PTH4, PTH5, PTH6 or PTH7 [note that these are on KBI1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The source causing the interrupt is visible in KBI1_SP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To add PTC inputs the following can be called as well (or in place of)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KE_PORTC&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                                 &lt;SPAN class="comment token"&gt;// the port that the interrupt input is on (KE_PORTE, KE_PORTF, KE_PORTG and KE_PORTH are the same)&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT5 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT6 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; KE_PORTC_BIT7&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// the IRQs inputs connected&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These PTCx inputs happen to be on KBI0 but the HAL automates all the internal details.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By doing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; KE_PORTC&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                                 &lt;SPAN class="comment token"&gt;// the port that the interrupt input is on (KE_PORTE, KE_PORTF, KE_PORTG and KE_PORTH are the same)&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT0&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                     &lt;SPAN class="comment token"&gt;// the IRQs input connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_PTC0_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT3&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                     &lt;SPAN class="comment token"&gt;// the IRQs input connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_PTC3_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_port_bits &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;KE_PORTC_BIT7&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                     &lt;SPAN class="comment token"&gt;// the IRQs input connected&lt;/SPAN&gt;
    interrupt_setup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;int_handler    &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kbi_PTC7_interrupt&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                 &lt;SPAN class="comment token"&gt;// handling function&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;fnConfigureInterrupt&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt;interrupt_setup&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;                      &lt;SPAN class="comment token"&gt;// configure interrupt&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each of the possible interrupts then has its own interrupt callback so that each input can directly have its own unique code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beware that the KBI controller only allows one interrupt to be recognised at a time. A second will only be recognised when the first has been removed - that means that it can't be used when more that one interrupt is in the triggering state (this is a potential restriction in using the KBI for some practical applications).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Complete Kinetis solutions for professional needs, training and support: &lt;A href="http://www.utasker.com/kinetis.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;i.MX RT project compatibility: &lt;A href="http://www.utasker.com/iMX.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/iMX.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Kinetis KE:&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE02Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE02Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE02Z40M.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE02Z40M.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE04Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE04Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE06Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE06Z.html&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;- &lt;A href="http://www.utasker.com/kinetis/FRDM-KE15Z.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/kinetis/FRDM-KE15Z.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="color: #000080;"&gt;&lt;EM&gt;uTasker: supporting &amp;gt;1'000 registered Kinetis users get products faster and cheaper to market&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Request Free emergency remote desk-top consulting at &lt;A href="http://www.utasker.com/services.html" rel="nofollow noopener noreferrer" target="test_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Open Source version at &lt;A href="https://github.com/uTasker/uTasker-Kinetis" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://github.com/uTasker/uTasker-Kinetis&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/512558" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://community.nxp.com/thread/512558&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/352862" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://community.nxp.com/thread/352862&lt;/A&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://community.nxp.com/thread/498809" rel="nofollow noopener noreferrer" target="test_blank"&gt;https://community.nxp.com/thread/498809&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Oct 2019 19:56:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936620#M54223</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-10-17T19:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KE06Z Change KBI Example Port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936621#M54224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm hoping for information directly regarding the example code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 08:45:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936621#M54224</guid>
      <dc:creator>stevenlutz</dc:creator>
      <dc:date>2019-10-18T08:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KE06Z Change KBI Example Port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936622#M54225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry but I don't know anything about the sample code and I only have proven working code.&lt;BR /&gt;You can look at that to maybe better understand the operation and then you will be in a position to either modify the sample of code or correct it accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 17:36:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936622#M54225</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-10-18T17:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KE06Z Change KBI Example Port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936623#M54226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Steven&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without looking at the example code I think that the main problem that you have is quite obvious due to the fact that the inputs on PTH and PTC are not controlled by the same KBI. If you just change the port reference you may be causing the code to configure the peripherals functions correctly on the ports but the original code will be configuring the wrong KBI (as noted above, PTH pins are controlled by KBI1 and PTC pins are controlled by KBI0, which means that you at least need also to change the KBI accessed in the example code - and probably also apply clocks correctly at different locations in the project code as well, plus configure and enter different interrupt vectors).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would mean that the example code is not generic (only works for the example pins) and needs to be completely understood and modified accordingly to the exact pins used. This is why example code is often inflexible and can result in lots of additional development to make what should be trivial changes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you look at the uTasker KBI code, which is are real solution rather than just an example, you will find that it uses a look up table to map pins, KBI inputs and KBI controllers so that the user can work on delivering products rather than fighting with data sheets and slipping project schedules. [&lt;EM&gt;If you are a professional developer, how much has it cost your company so far to switch KBI pins from PTH to PTC?&lt;/EM&gt;]. For the KE06:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;const&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;unsigned&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;char&lt;/SPAN&gt; _KBI&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;PORTS_AVAILABLE&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;32&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTA0..PTA7&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;29&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTB0..PTB7&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;16&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;17&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;18&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;19&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;21&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;22&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;23&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTC0..PTC7&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;24&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;25&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;26&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;27&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;28&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;29&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_0 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;31&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTD0..PTD7&lt;/SPAN&gt;

    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTE0..PTE7&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;8&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;9&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;  &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;10&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;12&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;13&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;14&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;15&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTF0..PTF7&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;16&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;17&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;18&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;19&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;20&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;21&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;22&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;23&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTG0..PTG7&lt;/SPAN&gt;
     &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;24&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;25&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;26&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;27&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;28&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;29&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;30&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_KBI_1 &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;31&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;// PTH0..PTH7&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This shows clearly that PTH are connected to KBI1 and PTC to KBI0.&lt;BR /&gt;Potentially more complicated are PTD pins since most are connected to KBI0 but two of them are connected to KBI1, making for potentially days of development and debugging when trying to edit examples to get them all working if the details are not initially well understood.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A good generic driver will allow the user to state what he/she wants to connect - eg.&amp;nbsp; PTD0, PTD7, PTC4 and PTH2 to an interrupt callback - and it sorts out the nitty-gritty so that the development is successfully completed within a few minutes instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Oct 2019 22:09:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936623#M54226</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2019-10-18T22:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-KE06Z Change KBI Example Port</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936624#M54227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Steven Lutz,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you need to change is the&amp;nbsp;definitions:&lt;/P&gt;&lt;P&gt;#define EXAMPLE_KBI &lt;STRONG&gt;KBI0&lt;/STRONG&gt;&lt;BR /&gt;#define EXAMPLE_KBI_PINS (&lt;STRONG&gt;10&lt;/STRONG&gt;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;This &lt;EM&gt;#define EXAMPLE_KBI_SIGNAL_INPUT_REF_GPIO kGPIO_PORTH&lt;/EM&gt; is used to generate a signal trigger &lt;STRONG&gt;KBI0&lt;/STRONG&gt;_P&lt;STRONG&gt;10&lt;/STRONG&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="KBI example.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93059i34C95F85022CF58E/image-size/large?v=v2&amp;amp;px=999" role="button" title="KBI example.png" alt="KBI example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="FRDM-KE06Z KBI example.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93103i4C09D46771C6FB45/image-size/large?v=v2&amp;amp;px=999" role="button" title="FRDM-KE06Z KBI example.png" alt="FRDM-KE06Z KBI example.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use the PTC7 as KBI function, then please change:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#define EXAMPLE_KBI&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;KBI0&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;#define EXAMPLE_KBI_PINS (&lt;/SPAN&gt;&lt;STRONG&gt;23&lt;/STRONG&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="KBI0.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/93153iE263A46728C87FCC/image-size/large?v=v2&amp;amp;px=999" role="button" title="KBI0.png" alt="KBI0.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;Robin&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px; font-size: 14px;"&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>Mon, 21 Oct 2019 07:39:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/FRDM-KE06Z-Change-KBI-Example-Port/m-p/936624#M54227</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2019-10-21T07:39:28Z</dc:date>
    </item>
  </channel>
</rss>

