<?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 KBI Interrupt on KE02 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028273#M56418</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to use the KBI0, Pin 1 Interrupt on a KE02Z processor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Kinetis Design Studio 3.2.0 with Processor Expert version shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90158i9B459700645B0228/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KBI Processor Expert (Sync_Int:init_KBI) component looks like this:&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/90216iDDCCFFB3D5640FBD/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;and appears to be a bit incomplete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've modified/added-to&amp;nbsp;the automatically-generated code and here's what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;** ===================================================================&lt;BR /&gt;** Method : Sync_Int_Init (component Init_KBI)&lt;BR /&gt;** Description :&lt;BR /&gt;** This method initializes registers of the KBI module&lt;BR /&gt;** according to the Peripheral Initialization settings.&lt;BR /&gt;** Call this method in user code to initialize the module. By&lt;BR /&gt;** default, the method is called by PE automatically; see "Call&lt;BR /&gt;** Init method" property of the component for more details.&lt;BR /&gt;** Parameters : None&lt;BR /&gt;** Returns : Nothing&lt;BR /&gt;** ===================================================================&lt;BR /&gt;*/&lt;BR /&gt;void Sync_Int_Init(void)&lt;BR /&gt;{&lt;BR /&gt; // Connect system clock to KBI0 module (not well documented)&lt;BR /&gt; SIM_SCGC |= SIM_SCGC_KBI0_MASK;&lt;BR /&gt; /* KBI0_SC: ??=0,??=0,??=0,??=0,KBF=0,KBACK=0,KBIE=0,KBMOD=0 */&lt;BR /&gt; KBI0_SC = 0x00;&lt;BR /&gt; /* KBI0_ES: KBEDG=2 */&lt;BR /&gt; KBI0_ES = KBI_ES_KBEDG(0x02);&lt;BR /&gt; /* KBI0_PE: KBIPE=2 */&lt;BR /&gt; KBI0_PE = KBI_PE_KBIPE(0x02);&lt;BR /&gt; /* KBI0_SC: KBACK=1 */&lt;BR /&gt; KBI0_SC |= KBI_SC_KBACK_MASK;&lt;BR /&gt; /* KBI0_SC: KBIE=1 */&lt;BR /&gt; KBI0_SC |= KBI_SC_KBIE_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;** ###################################################################&lt;BR /&gt;**&lt;BR /&gt;** The interrupt service routine(s) must be implemented&lt;BR /&gt;** by user in one of the following user modules.&lt;BR /&gt;**&lt;BR /&gt;** If the "Generate ISR" option is enabled, Processor Expert generates&lt;BR /&gt;** ISR templates in the CPU event module.&lt;BR /&gt;**&lt;BR /&gt;** User modules:&lt;BR /&gt;** main.c&lt;BR /&gt;** Events.c&lt;BR /&gt;**&lt;BR /&gt;** ###################################################################&lt;BR /&gt;** */&lt;BR /&gt;PE_ISR(Sync_Interrupt)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* KBI0_SC: KBIE=1 */&lt;BR /&gt; KBI0_SC |= KBI_SC_KBACK_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... &amp;lt;my code here&amp;gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can download the code and KBI seems to initialize ok, but the ISR is never called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/503303"&gt;Making a KBI Library...&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which (at the end of the reply) references&amp;nbsp;NVIC_ICER and NVIC_IPER6. I see documentation on the second register - just a place to set the interrupt priority. But what is NVIC_ICER? I don't see that even mentioned in the reference manual. Is there a bit in that register that turns on the KBI interrupt?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any insight you can provide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~LMG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Jan 2020 16:12:44 GMT</pubDate>
    <dc:creator>lmg</dc:creator>
    <dc:date>2020-01-17T16:12:44Z</dc:date>
    <item>
      <title>KBI Interrupt on KE02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028273#M56418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to use the KBI0, Pin 1 Interrupt on a KE02Z processor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using Kinetis Design Studio 3.2.0 with Processor Expert version shown below:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/90158i9B459700645B0228/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KBI Processor Expert (Sync_Int:init_KBI) component looks like this:&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/90216iDDCCFFB3D5640FBD/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;and appears to be a bit incomplete.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've modified/added-to&amp;nbsp;the automatically-generated code and here's what I have so far:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;** ===================================================================&lt;BR /&gt;** Method : Sync_Int_Init (component Init_KBI)&lt;BR /&gt;** Description :&lt;BR /&gt;** This method initializes registers of the KBI module&lt;BR /&gt;** according to the Peripheral Initialization settings.&lt;BR /&gt;** Call this method in user code to initialize the module. By&lt;BR /&gt;** default, the method is called by PE automatically; see "Call&lt;BR /&gt;** Init method" property of the component for more details.&lt;BR /&gt;** Parameters : None&lt;BR /&gt;** Returns : Nothing&lt;BR /&gt;** ===================================================================&lt;BR /&gt;*/&lt;BR /&gt;void Sync_Int_Init(void)&lt;BR /&gt;{&lt;BR /&gt; // Connect system clock to KBI0 module (not well documented)&lt;BR /&gt; SIM_SCGC |= SIM_SCGC_KBI0_MASK;&lt;BR /&gt; /* KBI0_SC: ??=0,??=0,??=0,??=0,KBF=0,KBACK=0,KBIE=0,KBMOD=0 */&lt;BR /&gt; KBI0_SC = 0x00;&lt;BR /&gt; /* KBI0_ES: KBEDG=2 */&lt;BR /&gt; KBI0_ES = KBI_ES_KBEDG(0x02);&lt;BR /&gt; /* KBI0_PE: KBIPE=2 */&lt;BR /&gt; KBI0_PE = KBI_PE_KBIPE(0x02);&lt;BR /&gt; /* KBI0_SC: KBACK=1 */&lt;BR /&gt; KBI0_SC |= KBI_SC_KBACK_MASK;&lt;BR /&gt; /* KBI0_SC: KBIE=1 */&lt;BR /&gt; KBI0_SC |= KBI_SC_KBIE_MASK;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;** ###################################################################&lt;BR /&gt;**&lt;BR /&gt;** The interrupt service routine(s) must be implemented&lt;BR /&gt;** by user in one of the following user modules.&lt;BR /&gt;**&lt;BR /&gt;** If the "Generate ISR" option is enabled, Processor Expert generates&lt;BR /&gt;** ISR templates in the CPU event module.&lt;BR /&gt;**&lt;BR /&gt;** User modules:&lt;BR /&gt;** main.c&lt;BR /&gt;** Events.c&lt;BR /&gt;**&lt;BR /&gt;** ###################################################################&lt;BR /&gt;** */&lt;BR /&gt;PE_ISR(Sync_Interrupt)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* KBI0_SC: KBIE=1 */&lt;BR /&gt; KBI0_SC |= KBI_SC_KBACK_MASK;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... &amp;lt;my code here&amp;gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can download the code and KBI seems to initialize ok, but the ISR is never called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found this post:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/503303"&gt;Making a KBI Library...&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which (at the end of the reply) references&amp;nbsp;NVIC_ICER and NVIC_IPER6. I see documentation on the second register - just a place to set the interrupt priority. But what is NVIC_ICER? I don't see that even mentioned in the reference manual. Is there a bit in that register that turns on the KBI interrupt?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for any insight you can provide.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~LMG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 16:12:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028273#M56418</guid>
      <dc:creator>lmg</dc:creator>
      <dc:date>2020-01-17T16:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: KBI Interrupt on KE02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028274#M56419</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;See the ARM core documentation, which is not included in the user's manual: &lt;A href="http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/Cihbiadi.html" target="test_blank"&gt;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0662b/Cihbiadi.html&lt;/A&gt;&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;EM&gt;[uTasker project developer for Kinetis and i.MX RT]&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Jan 2020 10:39:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028274#M56419</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-01-18T10:39:57Z</dc:date>
    </item>
    <item>
      <title>Re: KBI Interrupt on KE02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028275#M56420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the NVIC register summary, see &lt;STRONG&gt;NVIC_ISER&lt;/STRONG&gt; and &lt;STRONG&gt;NVIC_ICER&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="NVIC ISER ICER.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/97712i3CDF8E220A4DB2A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="NVIC ISER ICER.png" alt="NVIC ISER ICER.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The&amp;nbsp;Interrupt vector assignments of KBI0 in KE02 are same as KE04, you can use the codes in that post.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Interrupt vector assignments.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/97752i98D0C1DD5D1B737F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Interrupt vector assignments.png" alt="Interrupt vector assignments.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From your codes, rising edge is configured for this pin.&amp;nbsp;Did you&amp;nbsp;enable internal pull-down or put external pull-down for KBI0 pin1?&lt;/P&gt;&lt;P&gt;Here the&amp;nbsp;"deasserted logic levels" is 0v for your configuration.&lt;span class="lia-inline-image-display-wrapper" image-alt="Edge-only sensitivity.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/97799i65D193FC4B4C2105/image-size/large?v=v2&amp;amp;px=999" role="button" title="Edge-only sensitivity.png" alt="Edge-only sensitivity.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Best Regards,&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;Robin&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #51626f; background-color: #ffffff; border: 0px;"&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>Sun, 19 Jan 2020 08:25:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028275#M56420</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2020-01-19T08:25:50Z</dc:date>
    </item>
    <item>
      <title>Re: KBI Interrupt on KE02</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028276#M56421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks! Very helpful summary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~LMG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Jan 2020 22:44:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/KBI-Interrupt-on-KE02/m-p/1028276#M56421</guid>
      <dc:creator>lmg</dc:creator>
      <dc:date>2020-01-20T22:44:13Z</dc:date>
    </item>
  </channel>
</rss>

