<?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 Doubt in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178809#M5916</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working on Code warrior Development Studio version 5.0 for MC9S12XDP512 MCU on SK-S12XDP512A demo kit.&amp;nbsp;I want to check the status of the pushbutton on led connected to the PortB Pins. Can the pushbutton be&amp;nbsp;given as an interrupt? If so, what interrupt type would it be? a Hardware Trigger? a Real time Interrupt? or what?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 24 Feb 2010 17:58:12 GMT</pubDate>
    <dc:creator>admin</dc:creator>
    <dc:date>2010-02-24T17:58:12Z</dc:date>
    <item>
      <title>Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178809#M5916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am working on Code warrior Development Studio version 5.0 for MC9S12XDP512 MCU on SK-S12XDP512A demo kit.&amp;nbsp;I want to check the status of the pushbutton on led connected to the PortB Pins. Can the pushbutton be&amp;nbsp;given as an interrupt? If so, what interrupt type would it be? a Hardware Trigger? a Real time Interrupt? or what?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2010 17:58:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178809#M5916</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-02-24T17:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178810#M5917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You cannot generate an interrupt clicking on a push button in the visualization tool window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Feb 2010 21:32:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178810#M5917</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2010-02-24T21:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178811#M5918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;hello, thank you.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 01:25:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178811#M5918</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-02-25T01:25:53Z</dc:date>
    </item>
    <item>
      <title>n we make it work onRe: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178812#M5919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But can we make it work on a Demo Kit? The input will be the push button the status of which can be seen on an led...&lt;/P&gt;&lt;P&gt;SK-S12XDP512A is the demo kit I am using.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 12:26:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178812#M5919</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-02-25T12:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: n we make it work onRe: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178813#M5920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi, checkout the processor expert help "Tutorial for Freescale HCS12 Project 2 Step 4" . I think it will solve your problem. It has given how to generate interrupt on button, since you are using a hardware demo kit it should work. Thanks, Vivek&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Feb 2010 14:53:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178813#M5920</guid>
      <dc:creator>vivek31be</dc:creator>
      <dc:date>2010-02-25T14:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: n we make it work onRe: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178814#M5921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vivek,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have just tried it the way u suggested, but I am advised not to use the processor Expert as the code is generated within.... As a newbie this will not help me understand the programming of my microcontroller..&lt;/P&gt;&lt;P&gt;If u have any other idea of doing it.. just let me know..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 15:14:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178814#M5921</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-02-26T15:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178815#M5922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;All pushbuttons have something called "contact bounce". When you press down a button, the mechanical parts bounce up and down and generate an electrical disturbance for a short time. Connect an oscilloscope to any button and check, you will see a short sine wave when it is pressed.&lt;BR /&gt;&lt;BR /&gt;Another issue is electro-magnetical interference (EMI), "glitches" that are caused by noisy electronics. Such glitches can be removed through hardware with decoupling capacitors etc, but a serious embedded software designer will still have glitches in mind when writing the program.&lt;BR /&gt;&lt;BR /&gt;Because of the two issues above, you must "debounce" a button whenever you read its status.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is typically done this way:&lt;BR /&gt;&lt;BR /&gt;1) Set an interrupt on the port where the button is connected, or alternatively read ("poll") the port from the main program.&lt;BR /&gt;2) When the port goes active, you have either found a user pressing the button, or a contact bounce from a previous button press, or an EMI glitch. You don't know which.&lt;/P&gt;&lt;P&gt;3) Start a timer. 5ms is a good timer value. During this time, ignore the button port.&lt;BR /&gt;3) When the timer has elapsed, read the port again.&amp;nbsp;&lt;BR /&gt;4) Make sure that the values are the same during the 1st and the 2nd read. If they aren't, disregard the whole keypress - it was likely caused by EMI.&lt;BR /&gt;5) If the values were the same, light the LED etc.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Feb 2010 18:26:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178815#M5922</guid>
      <dc:creator>Lundin</dc:creator>
      <dc:date>2010-02-26T18:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178816#M5923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello, thank you so much. that was very informative... i will try it.thank u agn&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Mar 2010 21:44:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Doubt/m-p/178816#M5923</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2010-03-03T21:44:23Z</dc:date>
    </item>
  </channel>
</rss>

