<?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 PART 2: DEMO9S12XDT512 Interrupt Questions in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PART-2-DEMO9S12XDT512-Interrupt-Questions/m-p/124623#M154</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fforums.freescale.com%2Ffreescale%2Fboard%2Fmessage%3Fboard.id%3D16BITCOMM%26message.id%3D63" rel="nofollow noopener noreferrer" target="_blank"&gt;READ PART 1&lt;/A&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Wed Aug 24, 2005 4:16 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;I solved the problem by using the following instructions.&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp; //INT_XGPRIO = 0x01;&lt;BR /&gt;&amp;nbsp; //INT_CFADDR = Vportp &amp;amp; 0xF0; //Set PortP for XGate&lt;BR /&gt;&amp;nbsp; //INT_CFDATA7 = 0x81;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;That's the correct approach&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;One last question: How can I delete an Interrupt Flag from the Xgate module:&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;interrupt void _testPortP(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; asm NOP;&lt;BR /&gt;&amp;nbsp; //asm BRK;&lt;BR /&gt;&amp;nbsp; PIFP_PIFP0 = 1;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; //clear interrupt flag PortP 0&lt;BR /&gt;}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;&lt;BR /&gt;this example ISR deletes the interrupt flag (PortP0) if serviced by the HCS12 core.&lt;BR /&gt; But in the Xgate module the corresponding adress of the PIFP register (PortP interrupt flag) doesn't work &lt;A href="http://www.freegeeks.net/modules/Forums/images/smiles/icon_sad.gif" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt="Sad" border="0" src="http://www.freegeeks.net/modules/Forums/images/smiles/icon_sad.gif" /&gt;&lt;/A&gt;.&lt;BR /&gt; Is there a header file or documentation about how to delete interrupt flags serviced by the Xgate?&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Your code will be identical on the CPU and XGATE: that is the great joy of working in C with the XGATE - moving ISRs is very easy.&lt;BR /&gt;The address is actually the same for the CPU and for the XGATE since the registers are at the same location in each memory map, but even if it was not the CodeWarrior tools would automatically calculate the correct value.&lt;BR /&gt;I'm not sure if you are saying that the compilation fails or that the XGATE sets the wrong address. For the compile to work the XGATE source code must include the register header file. Also make sure your ISR is at the correct place in the XGATE vector table and is in the .cxgate file. (If it is in a .c file it will be compiled by the CPU compiler and the binary will be all wrong).&lt;BR /&gt;If the XGATE is not accessing the port to clear the flag then I would recommend you go to the debugger and trace what's happening.&lt;BR /&gt;&lt;SPAN style="FONT-WEIGHT: bold;"&gt;To have a breakpoint on the demo board you must allow the CPU to load the XGATE code into RAM before you set the breakpoint.&lt;/SPAN&gt;&lt;BR /&gt;You can do this by stepping into the the main routine since CW now loads the RAM in the startup file (with the initialisation).&lt;BR /&gt;Let us know how it goes.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Aug 26, 2005 8:25 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;thank you very much for your help! The interrupt jumps to the ISR. That works without any problem. But I still have the problem with deleting the interrupt flag. I tried it his way:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&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;interrupt void _testPortP(void) //ISR in xgate.cxgate for PortP {&amp;nbsp;&amp;nbsp; asm NOP;&amp;nbsp; XGIF4 |= XGIF4_XGIF_39_MASK; //write 1 interrupt to&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //PortP&amp;nbsp; (delete flag )&amp;nbsp;&amp;nbsp;&amp;nbsp; asm BRK; }&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;XGIF4 is the register where the corresponding interrupt flag in the XGate is deleted.&lt;BR /&gt;Following error ocurrs: write to RAM&lt;BR /&gt;May I work with semaphores???&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Aug 26, 2005 11:56 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;XGATE does not clear the flag in the XGIF registers. These flags are only for the CPU and are used when XGATE sends an interrupt on to the CPU so if you are handing the interrupt onto the CPU then you need to do this at the CPU ISR. See the figure 9-1 in the manual for the structure.&lt;BR /&gt; The interrupt you have to clear is the PORTP interrupt flag itself as you showed in your previous code segment. If you clear this then XGATE will not interrupt again until the PORTP gets another trigger.&lt;BR /&gt; If you can trace through the ISR on XGATE then you should be able to check the value of the PORTP interrupt before you leave the ISR. Check that XGATE is writing to the port correctly and that the flag is being cleared and that should give you an idea if the code is ok. Maybe PORTP is getting lots of interrupts?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="gensmall"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jan 2006 06:24:48 GMT</pubDate>
    <dc:creator>RChapman</dc:creator>
    <dc:date>2006-01-27T06:24:48Z</dc:date>
    <item>
      <title>PART 2: DEMO9S12XDT512 Interrupt Questions</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PART-2-DEMO9S12XDT512-Interrupt-Questions/m-p/124623#M154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;SPAN style="color: #ff0000;"&gt;This message contains an entire topic ported from a separate forum. The original message and all replies are in this single message. We have seeded this new forum with selected information that we expect will be of value to you as you search for answers to your questions.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fforums.freescale.com%2Ffreescale%2Fboard%2Fmessage%3Fboard.id%3D16BITCOMM%26message.id%3D63" rel="nofollow noopener noreferrer" target="_blank"&gt;READ PART 1&lt;/A&gt;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Wed Aug 24, 2005 4:16 pm&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;I solved the problem by using the following instructions.&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;&amp;nbsp; //INT_XGPRIO = 0x01;&lt;BR /&gt;&amp;nbsp; //INT_CFADDR = Vportp &amp;amp; 0xF0; //Set PortP for XGate&lt;BR /&gt;&amp;nbsp; //INT_CFDATA7 = 0x81;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;That's the correct approach&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Quote:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="quote" style="border:0px solid black;"&gt;&lt;BR /&gt;One last question: How can I delete an Interrupt Flag from the Xgate module:&lt;BR /&gt;&lt;BR /&gt;&lt;TABLE align="center" border="0" cellpadding="3" cellspacing="1" width="90%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="border:0px solid black;"&gt;&lt;SPAN class="genmed"&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="code" style="border:0px solid black;"&gt;interrupt void _testPortP(void)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; asm NOP;&lt;BR /&gt;&amp;nbsp; //asm BRK;&lt;BR /&gt;&amp;nbsp; PIFP_PIFP0 = 1;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; //clear interrupt flag PortP 0&lt;BR /&gt;}&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN class="postbody"&gt;&lt;BR /&gt;&lt;BR /&gt;this example ISR deletes the interrupt flag (PortP0) if serviced by the HCS12 core.&lt;BR /&gt; But in the Xgate module the corresponding adress of the PIFP register (PortP interrupt flag) doesn't work &lt;A href="http://www.freegeeks.net/modules/Forums/images/smiles/icon_sad.gif" rel="nofollow noopener noreferrer" target="_blank"&gt;&lt;IMG alt="Sad" border="0" src="http://www.freegeeks.net/modules/Forums/images/smiles/icon_sad.gif" /&gt;&lt;/A&gt;.&lt;BR /&gt; Is there a header file or documentation about how to delete interrupt flags serviced by the Xgate?&lt;/SPAN&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN class="postbody"&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Your code will be identical on the CPU and XGATE: that is the great joy of working in C with the XGATE - moving ISRs is very easy.&lt;BR /&gt;The address is actually the same for the CPU and for the XGATE since the registers are at the same location in each memory map, but even if it was not the CodeWarrior tools would automatically calculate the correct value.&lt;BR /&gt;I'm not sure if you are saying that the compilation fails or that the XGATE sets the wrong address. For the compile to work the XGATE source code must include the register header file. Also make sure your ISR is at the correct place in the XGATE vector table and is in the .cxgate file. (If it is in a .c file it will be compiled by the CPU compiler and the binary will be all wrong).&lt;BR /&gt;If the XGATE is not accessing the port to clear the flag then I would recommend you go to the debugger and trace what's happening.&lt;BR /&gt;&lt;SPAN style="FONT-WEIGHT: bold;"&gt;To have a breakpoint on the demo board you must allow the CPU to load the XGATE code into RAM before you set the breakpoint.&lt;/SPAN&gt;&lt;BR /&gt;You can do this by stepping into the the main routine since CW now loads the RAM in the startup file (with the initialisation).&lt;BR /&gt;Let us know how it goes.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Aug 26, 2005 8:25 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;thank you very much for your help! The interrupt jumps to the ISR. That works without any problem. But I still have the problem with deleting the interrupt flag. I tried it his way:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&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;interrupt void _testPortP(void) //ISR in xgate.cxgate for PortP {&amp;nbsp;&amp;nbsp; asm NOP;&amp;nbsp; XGIF4 |= XGIF4_XGIF_39_MASK; //write 1 interrupt to&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //PortP&amp;nbsp; (delete flag )&amp;nbsp;&amp;nbsp;&amp;nbsp; asm BRK; }&lt;/PRE&gt;&lt;DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;XGIF4 is the register where the corresponding interrupt flag in the XGate is deleted.&lt;BR /&gt;Following error ocurrs: write to RAM&lt;BR /&gt;May I work with semaphores???&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;STRONG&gt;Posted: Fri Aug 26, 2005 11:56 am&lt;SPAN class="gen"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class="postdetails"&gt;&lt;SPAN class="postbody"&gt;XGATE does not clear the flag in the XGIF registers. These flags are only for the CPU and are used when XGATE sends an interrupt on to the CPU so if you are handing the interrupt onto the CPU then you need to do this at the CPU ISR. See the figure 9-1 in the manual for the structure.&lt;BR /&gt; The interrupt you have to clear is the PORTP interrupt flag itself as you showed in your previous code segment. If you clear this then XGATE will not interrupt again until the PORTP gets another trigger.&lt;BR /&gt; If you can trace through the ISR on XGATE then you should be able to check the value of the PORTP interrupt before you leave the ISR. Check that XGATE is writing to the port correctly and that the flag is being cleared and that should give you an idea if the code is ok. Maybe PORTP is getting lots of interrupts?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class="gensmall"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jan 2006 06:24:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/PART-2-DEMO9S12XDT512-Interrupt-Questions/m-p/124623#M154</guid>
      <dc:creator>RChapman</dc:creator>
      <dc:date>2006-01-27T06:24:48Z</dc:date>
    </item>
  </channel>
</rss>

