<?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>8-bit Microcontrollers中的主题 Re: LC60 -&amp;gt; KBI1 doesn't work!</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124546#M354</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is this really an "unintended operation" or just the way it normally is?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The pullup register is actually part of the GPIO and in that section it explicitly states that they will only function when the DDR is set for input.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Of course a further note in the KBI section would be welcomed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Perhaps in the list of initialisation steps at 7.4.4&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 28 Feb 2007 07:08:42 GMT</pubDate>
    <dc:creator>peg</dc:creator>
    <dc:date>2007-02-28T07:08:42Z</dc:date>
    <item>
      <title>LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124541#M349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm using MC9S08LC60. Its KBI1 module doesn't generate interrupt for me. All interrupts such as SCI, LCD, RTI work but KBI1 doesn't &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/A&gt; KBI1SC_KBF flag is never asserted.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here is my KBI1 initialization:&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;&amp;nbsp; KBI1ES = 0b10000000;&amp;nbsp; // PWR_MON-RisingEgde, M_BTN-FallingEgde,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // D_BTN-FallingEgde, UST-FallingEdge, KLMS-FallingEdge
&amp;nbsp; KBI1PE = 0b11011000;&amp;nbsp; // PWR_MON, M_BTN, *D_BTN*, UST, KLMS
&amp;nbsp; KBI1SC = 0b00000100;&amp;nbsp; // Edge detect, KBIIE = 0
&amp;nbsp; KBI1SC_KBACK = 1;
&amp;nbsp; KBI1SC_KBIE = 1;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you check for me please&amp;nbsp;KBI1 has a bug?&lt;/P&gt;&lt;P&gt;SDID of&amp;nbsp;the LC60 that I use: Rev=1, ID=12&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 21:22:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124541#M349</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-02-27T21:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124542#M350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi again,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My actual project work on PIC18LF4620. I want to port whole project to MC9S08LC60.&lt;/DIV&gt;&lt;DIV&gt;I have&amp;nbsp;four port-on-change interrupt at pic side to wake up in sleep.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;At freescale side, I wanted to change them with KBI interrupt.&lt;/DIV&gt;&lt;DIV&gt;But as learned, they are&amp;nbsp;not exactly same. For example, I have two buttons to wake up.&lt;/DIV&gt;&lt;DIV&gt;One of them is connected to KBI1PE2 and the other is to KBI1PE3. Both of them are pulled up to VDD via a external resistor 510K and pulled down to GND via a 100nF to prevent bouncing. KBI is configured to catch falling edge of the buttons.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If I press the first button (click event), KBI interrupt works well.&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;If I press the&amp;nbsp;second button (click event), KBI interrupt works well.&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;If I press the first button but don't release it&amp;nbsp;(onDownEvent), KBI interrupt works well.&lt;/DIV&gt;&lt;DIV&gt;At this state, If I press the&amp;nbsp;second button (click event), KBI interrupt doesn't work!!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Namely, when KBI1PE2=0, KBI can't catch the falling edge of KBI1PE3 pin that is the second button. So, as a result, MCU can't wake up.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is not a big problem for buttons. But in my application, I have also two switchs that indicate cover states of our product. Cover states can be any thing(first may be one [opened state], the other may be zero [closed state]) at any time. and the KBI doesn't work at that state.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;How can I solve this problem?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you.&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 01:56:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124542#M350</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-02-28T01:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124543#M351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I have asked someone to have a look at this.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 04:18:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124543#M351</guid>
      <dc:creator>freegeek</dc:creator>
      <dc:date>2007-02-28T04:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124544#M352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Base Pointer,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;This is unfortunately how the KBI works. All enabled KBI pins must be at the unasserted level to detect an event on one of the pins. This is because although the level/edge selection is per pin the actual edge level detection is done after all the pins are OR'd together. Take a look at the block Diagram and the Functional Description.&lt;/DIV&gt;&lt;DIV&gt;This is perhaps why it is called a Keyboard Interrupt Module as it is of very limited use for much else. Once you use more than one pin they have to be coordinated.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 06:04:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124544#M352</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-02-28T06:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124545#M353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;I have just verified that there is a unintended operation of the KBI as it relates to the port control registers.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;This might account for the reported error you are seeing.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;I found that the DDR of the port must be set to 0 (function as an input) for the port pull up/down enable function to work.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;If the DDR = 1, setting the pin to an output the pull up/down function is disabled.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;I suggest we make the following changes to the LC60 KBI chapter&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;FONT size="+0"&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;We will be adding the following note to the introduction section of the KBI section.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt; &lt;DIV align="left"&gt;&lt;SPAN class="996112619-27022007"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN class="996112619-27022007"&gt;&lt;FONT face="Arial"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="2"&gt;"To use the input pins associated with the KBI the data direction register (PTxDD)&amp;nbsp; and the pull up enable register (PTxPE) for the corresponding KBI inputs must be set to inputs data direction (PTxDDn&amp;nbsp;=0) and pull enable set (PTxPEn = 1)."&amp;nbsp; If the DDR is set for output then the pullup/pulldown is disabled&lt;SPAN class="229293022-27022007"&gt;.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN class="996112619-27022007"&gt;&lt;FONT face="Arial"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN class="996112619-27022007"&gt;&lt;FONT face="Arial"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;FONT color="#0000ff" face="Arial" size="2"&gt;Does this answer the issue your are having?&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="229293022-27022007"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN class="996112619-27022007"&gt;&lt;FONT face="Arial"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;P. Drake&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV align="left"&gt;&lt;SPAN class="996112619-27022007"&gt;&lt;FONT face="Arial"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT size="2"&gt;&lt;SPAN class="229293022-27022007"&gt;8- bit Applications Engineer&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 06:39:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124545#M353</guid>
      <dc:creator>philip_drake</dc:creator>
      <dc:date>2007-02-28T06:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124546#M354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is this really an "unintended operation" or just the way it normally is?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The pullup register is actually part of the GPIO and in that section it explicitly states that they will only function when the DDR is set for input.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Of course a further note in the KBI section would be welcomed.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Perhaps in the list of initialisation steps at 7.4.4&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 07:08:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124546#M354</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-02-28T07:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124547#M355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello BP,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;To handle multiple, overlapping&amp;nbsp;key presses using the KBI module might be possible with the following approach -&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Whenever a key is pressed, it generates an interrupt that wakes up the MCU.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Within the ISR code,&amp;nbsp;the pressed key would be ascertained and&amp;nbsp;action taken to flag the event.&amp;nbsp; Interrupts&amp;nbsp;would then be disabled for &lt;U&gt;that&lt;/U&gt; key only, before exiting the ISR.&amp;nbsp; You might also&amp;nbsp;start a debounce delay period within the ISR, in lieu of your CR input&amp;nbsp;filter, (but don't wait until timeout occurs before exiting the ISR).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;With&amp;nbsp;each interrupt disabled while the key remains pressed, this should allow other keys to be sensed, and to generate&amp;nbsp;new interrupts.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;From within main(), or an associated function,&amp;nbsp; you might then periodically test, firstly for completion of the debounce timeout period, and after this has occurred, for the key being in a released state.&amp;nbsp; Only after the key has been released would the interrupt be re-enabled for that particular keyswitch.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;You should not re-enter stop mode until all keyswitches have been released (and the KBI interrupt has been re-enabled for all keyswitches).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 10:35:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124547#M355</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-02-28T10:35:05Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124548#M356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The method proposed by Mac above does indeed work! I use a similar method in a real world application. It has some limitations though which are application dependant. In my application none of these cause any problem, as for this one I don't know.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 11:05:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124548#M356</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-02-28T11:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124549#M357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi again to all,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Such as peg mentioned previously, unfortunately this is normal activity of the KBI module &lt;IMG alt=":smileysad:" class="emoticon emoticon-smileysad" id="smileysad" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-sad.gif" title="Smiley Sad" /&gt;&lt;/DIV&gt;&lt;DIV&gt;We can see it on Figure 7-2. Keyboard Interrupt (KBI) Block Diagram in the LC60 Datasheet.&lt;/DIV&gt;&lt;DIV&gt;I have changed KBI module to detect "level" and reconfigure KBI1ES register in interrupt routine.&lt;/DIV&gt;&lt;DIV&gt;Now, the code exactly works like PIC's on-change interrupt and all pins are independent.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="msg_source_code"&gt;&lt;SPAN class="text_smallest"&gt;Code:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;PRE&gt;  PTADD = 0;  KBI1SC = 0b00000100;  // level detect, KBIIE = 0  KBI1PE = 0b11011000;  // PWR_MON, M_BTN, *D_BTN*, UST, KLMS  KBI1ES = ~PTAD;  KBI1SC_KBIE = 1;  EnableInterrupts;      while(1)  {    __asm stop;    PTCD_PTCD2 = !PTCD_PTCD2;  // toogle BACKLIGHT to debug  }interrupt vNum_Vkeyboard1 void intKBI1(void){  unsigned char dummy;    dummy = PTAD;  KBI1ES = ~dummy; // change level to detect    KBI1SC_KBACK = 1;}&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you su much for your helps.&lt;BR /&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Feb 2007 15:11:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124549#M357</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-02-28T15:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124550#M358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello BP,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Your choice to change the edge select bit (instead of the pin enable bit), once a keypress has been detected, may have an unintended side effect.&amp;nbsp; This is because the internal pull-up resistor for a negative edge,&amp;nbsp;will automatically become a pull-down resistor&amp;nbsp;when a positive edge is selected.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;The value of this internal resistor will lie somewhere between 17.5k and 52.5k, and will swamp your external pull-up resistor&amp;nbsp;of 510k.&amp;nbsp; This will also affect the time delay&amp;nbsp;for your debounce arrangement.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;When the the internal pull-down occurs, you won't be able to sense the release of the keyswitch (assuming the switch is returned to ground), because there will be insufficient external pull-up to over-ride the internal pull-down - this would require a resistor value in the region of 2k2.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 00:31:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124550#M358</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-03-01T00:31:23Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124551#M359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi bigmac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I&amp;nbsp;don't use internal pull up/down resistors at all (PTAPE = 0). When I enabled the KBI module,&amp;nbsp;are internal pull up/down resistors automatically activated?&amp;nbsp;We&amp;nbsp;can't use them because of power consumption.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;To prevent unwanted interrupts during changing KBI Edge Select (KBI1ES) register, I acknowledge the KBI interrupt after changing KBIES register. That seems enough for my application.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thank you,&lt;/DIV&gt;&lt;DIV&gt;BasePointer.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 00:56:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124551#M359</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-03-01T00:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124552#M360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello BP,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;It appears that the LC60 device permits the pullups to be enabled or disabled when the KBI function is active.&amp;nbsp; However, this is not true for all MCU types.&amp;nbsp; For some, the pullups are automatically enabled whenever the KBI function is enabled.&amp;nbsp; You don't get to choose.&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 02:50:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124552#M360</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-03-01T02:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124553#M361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thank you for the information Mac!&lt;/DIV&gt;&lt;DIV&gt;I hope LC60&amp;nbsp;doesn't do it so.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 14:08:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124553#M361</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-03-01T14:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124554#M362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;If you are not using pullup/pulldowns then how does the input pin change to the opposite state when the switch opens?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 14:17:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124554#M362</guid>
      <dc:creator>peg</dc:creator>
      <dc:date>2007-03-01T14:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: LC60 -&gt; KBI1 doesn't work!</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124555#M363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi peg,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm using pullups. But they are external. I don't use internal pullups of the MCU due to power consumption.&lt;/DIV&gt;&lt;DIV&gt;See attached Sw.gif file.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;BP.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Mar 2007 15:24:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/LC60-gt-KBI1-doesn-t-work/m-p/124555#M363</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-03-01T15:24:10Z</dc:date>
    </item>
  </channel>
</rss>

