<?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: Problem with KBI on MC13213</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132351#M3019</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Yes it is a manual control.&amp;nbsp; I&amp;nbsp;am not using the internal pull ups because as you say they change to pull downs when the edge polarity&amp;nbsp;is changed.&amp;nbsp; Although I haven't seen any really bad&amp;nbsp;bouncing on the encoder switches I suppose it may get worse with time so I may extend the debouncing time.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Thanks again for your help&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Oct 2006 15:25:02 GMT</pubDate>
    <dc:creator>chapster</dc:creator>
    <dc:date>2006-10-09T15:25:02Z</dc:date>
    <item>
      <title>Problem with KBI on MC13213</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132346#M3014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;I am using the MC13213 (based on the gt60) and am having a problem using the KBI.&amp;nbsp; I am using 2 encoders connected to PTA4-7.&amp;nbsp; I set them up as follows&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;KBI1PE = 0xf0;&amp;nbsp; // enable PTA4-7 as interrupts&lt;BR /&gt;KBI1SC_KBACK = 1;&amp;nbsp; // clear ack&lt;BR /&gt;KBI1SC_KBIE = 1;&amp;nbsp;&amp;nbsp; // enable interrupts&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Both encoders will generate interrupts but PTA6 and PTA7 will not generate an interrupt if PTA4 or PTA5 is 0 on startup.&amp;nbsp; Once one of them has generated an interrupt 6 and 7 always can regardless of the state of the other 2 pins.&amp;nbsp; Also, if the 4 and 5 are 1 on startup then they do not need to generate an interrupt before 6 and 7 can.&amp;nbsp; I can not see any reason for this behaviour and I do not change the KBI registers anywhere else in the code.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Oct 2006 22:11:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132346#M3014</guid>
      <dc:creator>chapster</dc:creator>
      <dc:date>2006-10-05T22:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with KBI on MC13213</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132347#M3015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello,&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;If you look at the simplified schematic data for the KBI module, you will see that all the&amp;nbsp;enabled KB inputs are ORed together before being fed to the interrupt generating circuitry.&amp;nbsp; Assuming that the interrupts will be edge-only triggered, and the PTA inputs will respond to a negative edge, if any one&amp;nbsp;of the enabled inputs goes low, it will generate an interrupt only if none of the&amp;nbsp;other enabled inputs&amp;nbsp;is already&amp;nbsp;low.&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;Once an interrupt has occurred, if you need to sense whether any other input has been activated, you would need to poll the port status prior to exiting the ISR.&amp;nbsp; If you were to temporarily disable any low state input from the KBI (from within the ISR),&amp;nbsp;this would enable the other inputs to also generate an interrupt.&amp;nbsp; Alternatively, you might&amp;nbsp;flip the edge&amp;nbsp;polarity so the next interrupt for that input would occur on the positive edge.&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;If the encoders you are using are also subject to switch bounce, you will need to disable&amp;nbsp;each input for a suitable switch de-bounce period following a transition.&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>Fri, 06 Oct 2006 00:11:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132347#M3015</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-06T00:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with KBI on MC13213</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132348#M3016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Thanks for the quick response!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You are correct, I am using edge only triggering and I am changing the flow polarity once an input changes state and have allowed 1ms for debouncing (I have measured a maximum od 0.5ms which caused early problems).&lt;/DIV&gt;&lt;DIV&gt;I do not disable low inputs but I do change the polarity once they are have generated the interrupt and gone low,&amp;nbsp;which I am guessing has the same effect.&amp;nbsp;This is probably why once both encoders are working they always will because the polarity is always correct.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;If I read the states of all the inputs at the beginning and set the edge polaritys accordingly this should work.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for that&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 15:13:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132348#M3016</guid>
      <dc:creator>chapster</dc:creator>
      <dc:date>2006-10-06T15:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with KBI on MC13213</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132349#M3017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Works fine now, no problems.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 15:40:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132349#M3017</guid>
      <dc:creator>chapster</dc:creator>
      <dc:date>2006-10-06T15:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with KBI on MC13213</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132350#M3018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello chapster,&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;There is a further issue associated with changing the polarity of the KBI that I have just realised, and which I assume you have already addressed&amp;nbsp;to make the arrangement work.&amp;nbsp; Whenever a KB input is enabled, a pull-up is automatically implemented for a negative edge.&amp;nbsp; However, if a positive edge is then selected, the pull-up becomes a pull-down - probably not what the encoders require if mechanical switching type.&amp;nbsp; I guess the simplest solution would be to over-ride the pull-down current using external pull-up resistors of sufficiently low value.&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;My gut feel would be to allow somewhat more than 1ms debounce interval - to allow for wider unit-to-unit variation, and cater for possible degredation over time.&amp;nbsp; Are the encoders used as manually actuated controls?&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>Fri, 06 Oct 2006 21:55:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132350#M3018</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-10-06T21:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with KBI on MC13213</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132351#M3019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Mac&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Yes it is a manual control.&amp;nbsp; I&amp;nbsp;am not using the internal pull ups because as you say they change to pull downs when the edge polarity&amp;nbsp;is changed.&amp;nbsp; Although I haven't seen any really bad&amp;nbsp;bouncing on the encoder switches I suppose it may get worse with time so I may extend the debouncing time.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;Thanks again for your help&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Oct 2006 15:25:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Problem-with-KBI-on-MC13213/m-p/132351#M3019</guid>
      <dc:creator>chapster</dc:creator>
      <dc:date>2006-10-09T15:25:02Z</dc:date>
    </item>
  </channel>
</rss>

