<?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 Re: How to configure multiple Interrupts in S12XE Family in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797318#M15665</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi HariCharan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need to touch INT_CFADDR and INT_CFDATAx at all, unless you want to enable interrupt nesting. If&amp;nbsp;nesting is required (bad idea usually), then still you are not limited to 8 levels. To save precious address space 8 INT_CFDATAx registers are paged. Changing INT_CFADDR you map to INT_CFDATAx different 8 interrupts priority registers.&amp;nbsp;From CodeWarrior project wizard created project with XGATE enabled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define ROUTE_INTERRUPT(vec_adr, cfdata)&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; \&lt;BR /&gt;&amp;nbsp; INT_CFADDR= (vec_adr) &amp;amp; 0xF0;&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; \&lt;BR /&gt;&amp;nbsp; INT_CFDATA_ARR[((vec_adr) &amp;amp; 0x0F) &amp;gt;&amp;gt; 1]= (cfdata)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp; ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, 0x81); /* RQST=1 and PRIO=1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use ROUTE_INTERRUPT macro to&amp;nbsp;set up interrupt priority of selected interrupt. As you may see, first INT_CFADDR is&amp;nbsp;modified, which maps different 8 vectors to INT_CFDATA , then specific INT_CFDATA is modified with&amp;nbsp;specified cfdata priority settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Jul 2018 16:46:23 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2018-07-10T16:46:23Z</dc:date>
    <item>
      <title>How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797317#M15664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using MC9S12XE family microcontroller I want to configure Multiple Interrupts in my device like Timer,SPI,CAN, etc.. while I am going through chapter 6 of&lt;A href="https://www.nxp.com/docs/en/data-sheet/MC9S12XEP100RMV1.pdf"&gt; Datasheet&lt;/A&gt;&amp;nbsp; I came across this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/65144i2317E5C9AAC682C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What I understand from the above context is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can configure only 8 Vector Interrupt Requests&amp;nbsp; out of 128 vector interrupt request selected by the INT_CFADDR&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for Example&lt;/P&gt;&lt;P&gt;if I am given&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Ignore programming Syntax*/&lt;/P&gt;&lt;P&gt;IVBR= 0xFF;&lt;/P&gt;&lt;P&gt;INT_CFADDR=0xA0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then starting from 0xA000 -0xA007 only these Vector Interrupts I can Configure in INT_CFDATA0-7&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about the other Interrupts If I need to configure?&lt;/P&gt;&lt;P&gt;If you look into the interrupt&amp;nbsp; vector Table of micro controller&amp;nbsp; present in &lt;A href="https://www.nxp.com/docs/en/data-sheet/MC9S12XEP100RMV1.pdf"&gt;DataSheet&lt;/A&gt;&amp;nbsp;SPI0 interrupt vector location(0XFFD8) AND CAN0 Transmit Interrupt location is (0XFFB0)&lt;/P&gt;&lt;P&gt;CAN0 Receive Interrupt location is (0XFFB2)&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I can't configure CAN0 interrupts along with SPI0 interrupts at a time&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same thing with other Interrupts also ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I understood after reading the those Interrupt configuration Registers in chapter 6 of &lt;A href="https://www.nxp.com/docs/en/data-sheet/MC9S12XEP100RMV1.pdf"&gt;Datasheet&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now my question is&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.So How Can I Overcome this problem by using this micro controller family?&lt;/P&gt;&lt;P&gt;2.So How can I configure the other interrupts like CANTx,CAN Rx,SPI along with Timer Interrupt ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If My understanding is wrong Please Excuse me, and please tell me the correct way of configuring the Multiple Vector Interrupt requests&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Datasheet:&lt;A class="link-titled" href="https://www.nxp.com/docs/en/data-sheet/MC9S12XEP100RMV1.pdf" title="https://www.nxp.com/docs/en/data-sheet/MC9S12XEP100RMV1.pdf"&gt;https://www.nxp.com/docs/en/data-sheet/MC9S12XEP100RMV1.pdf&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks In Advance:smileyhappy:&lt;/P&gt;&lt;P&gt;HariCharan&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 04:21:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797317#M15664</guid>
      <dc:creator>haricharanreddy</dc:creator>
      <dc:date>2018-07-10T04:21:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797318#M15665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi HariCharan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need to touch INT_CFADDR and INT_CFDATAx at all, unless you want to enable interrupt nesting. If&amp;nbsp;nesting is required (bad idea usually), then still you are not limited to 8 levels. To save precious address space 8 INT_CFDATAx registers are paged. Changing INT_CFADDR you map to INT_CFDATAx different 8 interrupts priority registers.&amp;nbsp;From CodeWarrior project wizard created project with XGATE enabled:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#define ROUTE_INTERRUPT(vec_adr, cfdata)&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; \&lt;BR /&gt;&amp;nbsp; INT_CFADDR= (vec_adr) &amp;amp; 0xF0;&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; \&lt;BR /&gt;&amp;nbsp; INT_CFDATA_ARR[((vec_adr) &amp;amp; 0x0F) &amp;gt;&amp;gt; 1]= (cfdata)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp; ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, 0x81); /* RQST=1 and PRIO=1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use ROUTE_INTERRUPT macro to&amp;nbsp;set up interrupt priority of selected interrupt. As you may see, first INT_CFADDR is&amp;nbsp;modified, which maps different 8 vectors to INT_CFDATA , then specific INT_CFDATA is modified with&amp;nbsp;specified cfdata priority settings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Jul 2018 16:46:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797318#M15665</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2018-07-10T16:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797319#M15666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Edward&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am not using Xgate for interrupt processing currently I just want my interrupts need to be processed by CPU only&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;currently I want to configure CAN Interrupts and PTI Interrupts Can you explain How it should be done?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 05:58:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797319#M15666</guid>
      <dc:creator>haricharanreddy</dc:creator>
      <dc:date>2018-08-27T05:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797320#M15667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looks like you read word Xgate and decided to ignore my reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, 0x81); /* RQST=1 and PRIO=1 */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;^^ this is used both to redirect specific interrupt to XGATE (2nd argument has bit 7 set), and to set interrupt priority. So to let SOFTWARETRIGGER0 be handled by CPU and set interrupt priority to 3 you call this macro with RQST=0 and PRIO=3:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ROUTE_INTERRUPT(SOFTWARETRIGGER0_VEC, 3);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 06:40:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797320#M15667</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2018-08-27T06:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797321#M15668</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for early reply&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I do when I have multiple source of interrupts&lt;/P&gt;&lt;P&gt;for example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have PTI and CAN Interrupts which are located in different vector locations of a vector Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ROUTE_INTERRUPT()&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;function for PTI&amp;nbsp;&lt;BR /&gt;and&amp;nbsp;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ROUTE_INTERRUPT()&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function for CAN&amp;nbsp; in same code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;After Configuring of CAN interrupt vector location&amp;nbsp; and priority using&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ROUTE_INTERRUPT()&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;what happens to PTI interrupt&amp;nbsp; &amp;nbsp;and priority configurations&amp;nbsp; in CFADDR and CFDATA registers which were configured earlier ?&lt;BR /&gt;&lt;BR /&gt;If you provide an example it will be helpful&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 07:04:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797321#M15668</guid>
      <dc:creator>haricharanreddy</dc:creator>
      <dc:date>2018-08-27T07:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797322#M15669</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;UL&gt;&lt;LI&gt;If I use&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ROUTE_INTERRUPT()&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;function for PTI&amp;nbsp;&lt;BR /&gt;and&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ROUTE_INTERRUPT()&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;BR /&gt;function for CAN&amp;nbsp; in same code&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="padding: 0px; min-height: 8pt;"&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp;After Configuring of CAN interrupt vector location&amp;nbsp; and priority using&amp;nbsp;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;ROUTE_INTERRUPT()&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;what happens to PTI interrupt&amp;nbsp; &amp;nbsp;and priority configurations&amp;nbsp; in CFADDR and CFDATA registers which were configured earlier ?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nothing happens,&amp;nbsp;PIT priority doesn't change after configuring CAN priority.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 12:06:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797322#M15669</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2018-08-27T12:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797323#M15670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Edward&lt;BR /&gt;&lt;BR /&gt;Is there any Default Priority to all 128 interrupts that micro controller follow i.e, &lt;BR /&gt;if don't configure any priority at all using priority configuration registers(IVBR,CFADDR,CFDATA)&amp;nbsp; what Micro controller does if any interrupt occurs ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 12:17:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797323#M15670</guid>
      <dc:creator>haricharanreddy</dc:creator>
      <dc:date>2018-08-27T12:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797324#M15671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, if you look at&amp;nbsp;&lt;/P&gt;&lt;P&gt;Interrupt Request Configuration Data Registers (INT_CFDATA0–7)&lt;/P&gt;&lt;P&gt;, reset default value for PRIOLVL[2:0] is 001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edward&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Aug 2018 12:24:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797324#M15671</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2018-08-27T12:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure multiple Interrupts in S12XE Family</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797325#M15672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you remember my answer for a case 00174354 (I also placed it bellow) where I wrote about XGATE. Now, I will talk about CPU only….&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;CPU can process as many interrupt as possible with priority level set from 0 to 7 (0 disables interrupt). Interrupt nesting is possible if I bit is cleared and interrupt with higher priority is asking for service.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;- HW interrupt have priority above I-bit maskable interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Each I bit maskable interrupt has following possibilities of enale/disable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI style="margin-bottom: .0001pt; text-indent: -18.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Clear/set I-bit – global enable/disable for all I-bit maskable interrupts at once&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-bottom: .0001pt; text-indent: -18.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Set CFADDR and CFDATA to select interrupt priority (0 – disable interrupt even it is enabled in registers settings for given peripher)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI style="margin-bottom: .0001pt; text-indent: -18.0pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;There is interrupt enable bit in the registers setting for each peripheral.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;If I do not want to use XGATE and only do not want to change priority of interrupts then it is enough to enable the interrupt by iven bit in peripheral setting registers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;However if I want to set a priority of the CPU interrupt only I can do that by macro:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SET_PRIORITY(channel, priority) \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFADDR= (channel&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; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFDATA_ARR[channel &amp;amp; 0x07] = priority&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;// from data sheet vector table, for example, for PIT module&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT0&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; 0x7A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT1&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; 0x78&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT2&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; 0x76&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT3&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; 0x74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SOFTWARETRIGGER0_VEC&amp;nbsp; 0x72&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SOFTWARETRIGGER1_VEC&amp;nbsp; 0x70&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define ATD0_AUTO_COMPARE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x3E&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Then anytime anywhere:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;SET_PRIORITY(ATD0_AUTO_COMPARE,1); // ATD0 auto compare, routed to CPU, priority 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;SET_PRIORITY(SOFTWARETRIGGER0_VEC, 3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;SET_PRIORITY(PIT0, 1);&amp;nbsp; // Route to CPU, priority 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;SET_PRIORITY(SOFTWARETRIGGER1_VEC, 7); // Route to CPU, priority 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Somewhere in time later, I want to change priority:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;SET_PRIORITY(PIT0, XGATE, 5);&amp;nbsp; // Route to CPU, priority 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Only to highlight, I have already wrote in the answer for a case 00174354 following.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;In the history I have used more variants of the definition, especially in the case when the device does not contain XGATE and there is CPU only. For example….&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Simplified:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SET_PRIORITY(channel, priority) \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFADDR= (channel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFDATA_ARR[channel &amp;amp; 0x07] = priority&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Or&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define ROUTE_INTERRUPT(vec_adr, cfdata)&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; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFADDR= (vec_adr) &amp;amp; 0xF0;&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; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFDATA_ARR[((vec_adr) &amp;amp; 0x0F) &amp;gt;&amp;gt; 1]= (cfdata)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;When you have to be sure what you are writing for priority:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; ROUTE_INTERRUPT(ATD0_VEC, 0x82); // Route to XGATE. Priority 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; ROUTE_INTERRUPT(PIT0, 0x03);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Route to CPU, priority 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I have also attached a few examples...what I have described above&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Some more things from my PC can be found&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&lt;A class="jive-link-wiki-small" data-containerid="11493" data-containertype="14" data-objectid="329209" data-objecttype="102" href="https://community.nxp.com/docs/DOC-329209"&gt;https://community.nxp.com/docs/DOC-329209&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;**********************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Answer on the case 00174354 when you asked question about XGATE interrupts:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I am talking about XGATE only for priority explanation….&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Can can process as many interrupt as possible with priority level set fro 0 to 7 (0 disables interrupt). But….&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;- In the case of interrupt nesting there is only&amp;nbsp; possibility that interrupt of level 1,2,3 can be interrupted only by interrupt with level 4,5,6,7. Also, interrupts in the same block are not able to be nested. For example, when priority level 6 is processed priority level 6 is not able to interrupt it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;- HW interrupt have priority above I-bit maskable interrupt and they are also not routable to XGATE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;The principle to set priority, I use is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CPU&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x00&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XGATE&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x80&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define ROUTE_INTERRUPT_SET_PRIORITY(channel, cpu_xgate, priority) \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFADDR= (channel&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; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFDATA_ARR[channel &amp;amp; 0x07] = (cpu_xgate|priority)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;// from data sheet vector table, for example, for PIT module&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT0&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; 0x7A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT1&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; 0x78&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT2&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; 0x76&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define PIT3&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; 0x74&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // vector address&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SOFTWARETRIGGER0_VEC&amp;nbsp; 0x72&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SOFTWARETRIGGER1_VEC&amp;nbsp; 0x70&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define ATD0_AUTO_COMPARE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0x3E&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Then anytime anywhere:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;ROUTE_INTERRUPT_SET_PRIORITY(ATD0_AUTO_COMPARE,CPU,1); // ATD0 auto compare, routed to CPU, priority 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;OUTE_INTERRUPT_SET_PRIORITY(SOFTWARETRIGGER0_VEC, CPU, 3);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;ROUTE_INTERRUPT_SET_PRIORITY(PIT0, XGATE, 1);&amp;nbsp; // Route to XGATE, priority 1&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;ROUTE_INTERRUPT(SOFTWARETRIGGER1_VEC, XGATE, 7); // Route to XGATE priority 7&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;…&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Somewhere in time later, I want to change priority:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;ROUTE_INTERRUPT_SET_PRIORITY(PIT0, XGATE, 5);&amp;nbsp; // Route to XGATE, priority 5&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Of course, you should keep and/or process correctly routing. If the has isr written for XGATE is not correct to route it to XGATE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;In the history I have used more variants of the definition, especially in the case when the device does not contain XGATE and there is CPU only. For example….&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Simplified:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define SET_PRIORITY(channel, priority) \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFADDR= (channel&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFDATA_ARR[channel &amp;amp; 0x07] = priority&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Or&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;#define ROUTE_INTERRUPT(vec_adr, cfdata)&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; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFADDR= (vec_adr) &amp;amp; 0xF0;&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; \&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; INT_CFDATA_ARR[((vec_adr) &amp;amp; 0x0F) &amp;gt;&amp;gt; 1]= (cfdata)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;When you have to be sure what you are writing for priority:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; ROUTE_INTERRUPT(ATD0_VEC, 0x82); // Route to XGATE. Priority 2&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp; ROUTE_INTERRUPT(PIT0, 0x03);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Route to CPU, priority 3&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;I have also attached a few examples...what I have described above&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;Some more things from my PC can be found&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&lt;A class="jive-link-wiki-small" data-containerid="11493" data-containertype="14" data-objectid="329209" data-objecttype="102" href="https://community.nxp.com/docs/DOC-329209"&gt;https://community.nxp.com/docs/DOC-329209&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 12.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Aug 2018 11:05:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-configure-multiple-Interrupts-in-S12XE-Family/m-p/797325#M15672</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2018-08-28T11:05:55Z</dc:date>
    </item>
  </channel>
</rss>

