<?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: Trace through IRQ?</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187765#M14217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;OK, I'm awake now.... gotta set IRQACK to clear the source!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;All's well.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Tim&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>Sat, 09 Feb 2008 02:27:23 GMT</pubDate>
    <dc:creator>UtopiaTim</dc:creator>
    <dc:date>2008-02-09T02:27:23Z</dc:date>
    <item>
      <title>Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187759#M14211</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;Hi folks,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I'm using a JM60 (on the DemoJM board).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My code is a combination of C and assembly.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Entering into one of the modules,&amp;nbsp; the first instruction&lt;/DIV&gt;&lt;DIV&gt;sets the IRQIE bit in IRQSC (enables the interrupt function of IRQ).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The next couple of instructions do mundane housekeeping.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I set a breakpoint several instructions down from the Bit enable instruction,&lt;/DIV&gt;&lt;DIV&gt;expecting the IRQ service routine to do it's thing (there is an interrupt pending),&lt;/DIV&gt;&lt;DIV&gt;then come back &amp;amp; do stuff from where it left.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The IRQ service routine only has the RTI instruction in it...&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The system goes really far in the weeds.&amp;nbsp; - I have to reload the code.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I haven't had any problems using either the I2C or Keyboard interrupts &amp;amp; tracing through&lt;/DIV&gt;&lt;DIV&gt;them, etc.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Was just wondering if I'm doing something wrong.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Tim&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>Fri, 08 Feb 2008 06:46:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187759#M14211</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-08T06:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187760#M14212</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hard to say without seeing the code.&lt;BR /&gt;Did you reset the rtc in flag in the handler?&lt;BR /&gt;You need this in the handler:&lt;BR /&gt;&amp;nbsp;RTCSC |= 0x80;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 12:01:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187760#M14212</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-02-08T12:01:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187761#M14213</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;HI Jim,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The RTC is an external I2C Maxim part, so I'm not using the RTC on the&lt;/DIV&gt;&lt;DIV&gt;JM60.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Wasn't sure if there was some reason that trying to use BDM/code warrior&amp;nbsp;with&lt;/DIV&gt;&lt;DIV&gt;IRQ would give me some problems.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Tim&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 21:01:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187761#M14213</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-08T21:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187762#M14214</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Tim,&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;I am not familiar with the JM60.&amp;nbsp; Does the BDM pin share tha same pin as IRQ.&amp;nbsp; If so, you cannot use the IRQ function whilst debugging.&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, 08 Feb 2008 21:17:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187762#M14214</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-08T21:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187763#M14215</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;I found it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I wasn't paying attention to the assembly code window....&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Looks like a PSHH is automatically inserted in the code by&lt;/DIV&gt;&lt;DIV&gt;Codewarrior (I guess).&amp;nbsp; I didn't do a PULH before the RTI, so the stack&lt;/DIV&gt;&lt;DIV&gt;was&amp;nbsp;wrong.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks again!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Tim&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 21:47:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187763#M14215</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-08T21:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187764#M14216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi Mac/all,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Still have an issue.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have reduced the hardware to a switch on IRQ. (not debounced)&lt;/DIV&gt;&lt;DIV&gt;IRQMOD=0 and IRQEDG=0 (falling edge triggered only).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I set a breakpoint for the beginning of the IRQ ISR, and it stops as soon&lt;/DIV&gt;&lt;DIV&gt;as I press the switch.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I step through the code, and it never exits the ISR.&amp;nbsp; The IRQ line is high.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Here's the basic code:&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;void main(void) {&lt;BR /&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp; asm {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cli&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;here:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bra here&lt;BR /&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;}&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;__interrupt void isrVirq(void){&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp; asm {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; nop&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pulh&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rti&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Ideas?&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Tim&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Feb 2008 23:55:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187764#M14216</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-08T23:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187765#M14217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi All,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;OK, I'm awake now.... gotta set IRQACK to clear the source!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;All's well.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Tim&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>Sat, 09 Feb 2008 02:27:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187765#M14217</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-09T02:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187766#M14218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;That's what I was tring to say (except you said RTC).&lt;BR /&gt;&lt;BR /&gt;99%&amp;nbsp; the time when the int handler goes into the weeds, it's cause you forgot to clear the source.&lt;BR /&gt;For some reason, PE does not add to that the handler either, so it is easy to forget.&lt;BR /&gt;Also the debugger really has no good way to identify this.&lt;BR /&gt;&lt;BR /&gt;I guess&amp;nbsp; I was not clear as far as a general statement goes.&lt;BR /&gt;* You MUST always clear the interrupt in the handler, if nothing else. *&lt;BR /&gt;Well, as least this was enough pain for you&amp;nbsp; to think of it next time.&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 02:45:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187766#M14218</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-02-09T02:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187767#M14219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thanks Jim,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;hehe,&amp;nbsp; I'm having a lot of those 'remembering' episodes!! &lt;IMG alt=":smileysurprised:" class="emoticon emoticon-smileysurprised" id="smileysurprised" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-surprised.gif" title="Smiley Surprised" /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It's been a while since I did an IRQ routine, and back then, there weren't any&lt;/DIV&gt;&lt;DIV&gt;flags to clear! (other than the I bit)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Got it now.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Tim&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Feb 2008 02:52:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187767#M14219</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-09T02:52:41Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187768#M14220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello Tim,&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;I am not sure whether part of your problem, but I question the advisability of the code you have posted.&amp;nbsp; The ISR function is entered using the __interrupt designation, and then you exit the ISR using inline assembler.&amp;nbsp; You are really second guessing how the compiler handles the interrupt, and what may have been pushed onto the stack.&amp;nbsp; The best approach is to let the compiler handle the exit from the ISR function.&amp;nbsp;&amp;nbsp;The following&amp;nbsp;framework is suggested.&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;&lt;/FONT&gt;&lt;DIV&gt;&lt;FONT color="#6633FF" face="Courier New" size="2"&gt;__interrupt void isrVirq(void)&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#6633FF" face="Courier New" size="2"&gt;{&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;asm {&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp; /* Do ASM things */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp;&amp;nbsp;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp; /* Do other C things */&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color="#6633FF"&gt;&amp;nbsp; /* Clear interrupt flag */&lt;BR /&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&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;I seem to recall that, for some MCU, the external IRQ flag is automatically cleared when the vector is fetched.&amp;nbsp; Perhaps there are differences for different MCU&amp;nbsp;types.&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;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Feb 2008 20:38:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187768#M14220</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2008-02-10T20:38:28Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187769#M14221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Hi Mac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for the tip!&amp;nbsp; That explains a lot.&amp;nbsp; (howcome CW adds the helpful PSHH &amp;amp; then&lt;/DIV&gt;&lt;DIV&gt;(with my rti) I had to supply the PULH)!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Took out the PULH &amp;amp; RTI, let it terminate with the }, and all is well.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I guess after so many years of assembly I wasn't used to something 'helping' me!!&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Thanks again!&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Tim&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Feb 2008 20:51:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187769#M14221</guid>
      <dc:creator>UtopiaTim</dc:creator>
      <dc:date>2008-02-11T20:51:46Z</dc:date>
    </item>
    <item>
      <title>Re: Trace through IRQ?</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187770#M14222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;What mac said is 100% correct.&lt;BR /&gt;&lt;BR /&gt;Just to further explain, the hardware does NOT save register H on interrupt, I believe for 05 compatibility.&lt;BR /&gt;So, if you do anything in the interrupt, in the compiler will save register H on the stack (apparently even if it did not need to) and restore it.&lt;BR /&gt;In th future, you can use the 'disassemble'&amp;nbsp; function&amp;nbsp; on the right click menu to view the code that compiler generated. It's a great cheat for writing assembly language. Also, you may decide to stop using assembly language once you better understand how the compiler does things, as using asm makes it harder to switch processors.&lt;BR /&gt;The for the few instructions that require asm language, there are provided macros that port to all Flexis family products. In a few months when the CF V1 USB chips come out, you may decide to move.&lt;BR /&gt;&lt;BR /&gt;Processor Expert is quite good at moving a project from 08 to CF, but it can't do much about asm code.&lt;BR /&gt;&lt;BR /&gt;If you generate all your I/O with Processor Expert, it can move you from 08 to Flexis with like 5 clicks. There is a demo that comes with the DEMOQE board that does just that. However, except for the vector table most i/o code will port either way.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;BR /&gt;Didn't really need to save it, but it did.&lt;BR /&gt;&lt;/DIV&gt;&lt;PRE&gt;   60:  volatile char data;       61:  __interrupt void isrVirq(void)   62:  {  0000 8b       [2]             PSHH  // the hardware doe NOT save this.   63:       64:    data = 1;   0001 a601     [2]             LDA   #1      0003 c70000   [4]             STA   data   65:    asm {   66:     67:    }   68:    /* Clear interrupt flag */   69:  }  0006 8a       [3]             PULH    0007 80       [9]             RTI      70:  &lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:38:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Trace-through-IRQ/m-p/187770#M14222</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2020-10-29T09:38:59Z</dc:date>
    </item>
  </channel>
</rss>

