<?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>S12 / MagniV MicrocontrollersのトピックRe: Interrupt Priority in MC9S12XS128</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232731#M9379</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, when you enabled TFFCA bit, read from an input capture or a write to the output compare channel will clear appropriate flags. So, you don't need take care about flag clearing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jun 2013 14:26:33 GMT</pubDate>
    <dc:creator>RadekS</dc:creator>
    <dc:date>2013-06-21T14:26:33Z</dc:date>
    <item>
      <title>Interrupt Priority in MC9S12XS128</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232726#M9374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Can somebody describe the procedure to set the interrupt priority for timer channel 0 interrupt?&lt;/P&gt;&lt;P&gt;i am using this interrupt for refreshing a LED matrix, and the period is 80 micro sec. since i also have CAN interrupt enabled, i'm able to see some deviation in the periodicity, which is causing flicker in the LED's. The LED's appear to flash randomly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 08:37:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232726#M9374</guid>
      <dc:creator>sirishmadhusudh</dc:creator>
      <dc:date>2013-06-21T08:37:58Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Priority in MC9S12XS128</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232727#M9375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;on S12X the priority scheme is different. Totally software interrupt priority is 0-7. the default software priority of all interrupts is 1. 0 means the interurpt is disabled. the higher number, the higher priority. For a interrupt, we can change its interrupt priority from 1 to 2 to higher its priority. the order of vector number is nothing to do with priority. I ever made a sample code on this topic. Hope you can lean something here!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 09:08:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232727#M9375</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2013-06-21T09:08:16Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Priority in MC9S12XS128</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232728#M9376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sirish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interrupt priority can be easily changed using this macro from CodeWarrior project wizard generated files:&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;/P&gt;&lt;P&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;/P&gt;&lt;P&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;Usage is ...&amp;nbsp; Unfortunately you didn't say what variant of S12X are you using. In case it is ECT channel 0 on S12XE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ROUTE_INTERRUPT ( Vectch0,&amp;nbsp; desired_priority_level) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vectch0 is vector address defined in derivative header file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ROUTE_INTERRUPT() is a half of the task. To make interrupts nested, you need to reenable interrupts in all lower priority interrupt handlers. &lt;/P&gt;&lt;P&gt;Priority levels mechanism works this way: when CPU enters interrupt&amp;nbsp; handler for level (for example) 2 interrupt, it sets I bit and sets current priority level to 2. I=1 disables all interrupts, PRIO=2 disables all interrupts with priority levels &amp;lt;=2. To enable Interrupts with priority levels &amp;gt;=3, you need to clear I bit. You should clear I bit (asm CLI;) as soon as you enter lower priority interrupts.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 11:10:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232728#M9376</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2013-06-21T11:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Priority in MC9S12XS128</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232729#M9377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just small specification: If there are more pending interrupts, interrupt with highest priority wins.&lt;/P&gt;&lt;P&gt;If there are more pending interrupts with the same priority and this priority is the highest, Interrupt with higher vector address wins (For example ECT0 will be executed prior ECT1).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Interrupt nesting and priority setting is already nicely described by kef.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like note here also typical software error which could cause described behavior:&lt;/P&gt;&lt;P&gt;If we use more than one timer channel, we should take care on flag clearing mechanism.&lt;/P&gt;&lt;P&gt;In short: TFLG1_C0F=1; is wrong command for flag clearing. This command cause reading TFLG1 register, modify C0F bit and write whole byte into TFLG1 register. This way we clear all pending flags.&lt;/P&gt;&lt;P&gt;Correct way should be for example: TFLG1=0x01; //clear C0F flag&lt;/P&gt;&lt;P&gt;Note: this is general recommendation, timer is just typical case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More details you can find in our application note AN2554 Clearing and Disabling Interrupt Flags&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.freescale.com/files/microcontrollers/doc/app_note/AN2554.pdf"&gt;http://www.freescale.com/files/microcontrollers/doc/app_note/AN2554.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 12:58:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232729#M9377</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2013-06-21T12:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Priority in MC9S12XS128</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232730#M9378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Radek,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thanks for the support. In my design, i am using multiple timer channels for interrupt. I have set the Timer Fast Flag Clear All (TSCR1_TFFCA) bit. I am using timer channel 0 and 1 independently.&lt;/P&gt;&lt;P&gt;The Timer Prescaler Selected gives me a clock of 16 micro sec.&lt;/P&gt;&lt;P&gt;For timer zero ISR, for a period of 80usec, i do TC0 = TCNT + 5 each time i enter the ISR.&lt;/P&gt;&lt;P&gt;for timer 1 ISR, for a period of 1 msec, i update the TC1 as TC1 = TC1+63.&lt;/P&gt;&lt;P&gt;In both ISRs i do not clear the TFLG1_C0F and TFLG1_C1F flags since i have set the TSCR1_TFFCA bit. Am i doing it right?&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sirish&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 14:03:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232730#M9378</guid>
      <dc:creator>sirishmadhusudh</dc:creator>
      <dc:date>2013-06-21T14:03:52Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt Priority in MC9S12XS128</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232731#M9379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, when you enabled TFFCA bit, read from an input capture or a write to the output compare channel will clear appropriate flags. So, you don't need take care about flag clearing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 14:26:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-Priority-in-MC9S12XS128/m-p/232731#M9379</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2013-06-21T14:26:33Z</dc:date>
    </item>
  </channel>
</rss>

