<?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: HCS12 MC9S12E128 Interrupt Problem in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201312#M8136</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt; asm("SWI"); // ???? Software interrupt?

Didn't you mean enable interrupts?
asm("CLI");

&lt;/PRE&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Mar 2008 01:19:10 GMT</pubDate>
    <dc:creator>JimDon</dc:creator>
    <dc:date>2008-03-11T01:19:10Z</dc:date>
    <item>
      <title>HCS12 MC9S12E128 Interrupt Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201311#M8135</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hey guys,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have been working using the C32 varient of the HCS12 OK and am quite comfortable with it. I have recently started using a E128 varient to take advantage of the I2C module but have been having trouble getting simple interrupts to work. As far as I can tell my code is fine.&lt;/SPAN&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;/DIV&gt;&lt;PRE&gt;#include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* common defines and macros */#include &amp;lt;mc9s12e128.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* derivative information *//* Interrupt for TIM0_TC4 */void interrupt 12 timer0TC4(void) {&amp;nbsp; TIM0_TC4 += 512;&amp;nbsp; PTT ^= 0xFF;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Toggle LEDS */&amp;nbsp; TIM0_TFLG1_C4F = 1; /* Reset flag */ }void main(void) {&amp;nbsp; DDRT = 0xFF;&amp;nbsp; PTT = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp; TIM0_TCTL1 = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Take no action */&amp;nbsp; TIM0_TSCR1 = 0x80;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable counter */&amp;nbsp; TIM0_TSCR2 = 0x00;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* No overlow flag/prescale */&amp;nbsp; TIM0_TIOS_IOS4 = 1;&amp;nbsp;&amp;nbsp; /* Enable O/C Timer1 */&amp;nbsp;&amp;nbsp;&amp;nbsp; TIM0_TFLG1_C4F = 1;&amp;nbsp;&amp;nbsp; /* Reset C4F flag */&amp;nbsp; TIM0_TIE = 0x10;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* Enable interrupt on TC1 */&amp;nbsp;&amp;nbsp;&amp;nbsp; asm("SWI");&amp;nbsp; TIM0_TC4 = TIM0_TCNT + 512; /* Set value to interrupt */&amp;nbsp;&amp;nbsp;&amp;nbsp; for(;;) {}&amp;nbsp; }&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;Does anyone see anything not right?&lt;BR /&gt;&lt;BR /&gt;I am using code warrior, and using the simulation it appears my TCNT isnt even counting - probably the cause of nothing working.&lt;BR /&gt;&lt;BR /&gt;Thanks again.&lt;BR /&gt;&lt;BR /&gt;Colin&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by Deadstar on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-03-09&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;04:57 PM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 09 Mar 2008 23:35:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201311#M8135</guid>
      <dc:creator>Deadstar</dc:creator>
      <dc:date>2008-03-09T23:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: HCS12 MC9S12E128 Interrupt Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201312#M8136</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt; asm("SWI"); // ???? Software interrupt?

Didn't you mean enable interrupts?
asm("CLI");

&lt;/PRE&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 01:19:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201312#M8136</guid>
      <dc:creator>JimDon</dc:creator>
      <dc:date>2008-03-11T01:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: HCS12 MC9S12E128 Interrupt Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201313#M8137</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Sorry, I was tried when I posted and edited it wrong.&lt;BR /&gt;&lt;BR /&gt;I am actually using &amp;nbsp; EnableInterrupts; instead but still no joy...&lt;BR /&gt;&lt;BR /&gt;My title is a bit misleading - it is really a timer problem. I have been able to use a&lt;BR /&gt;RTI successfully so it is just the timers that are the problem.&lt;BR /&gt;&lt;BR /&gt;I had no problem getting all the timers on the mc9s12c32 working so I am not sure why this is proving so hard.&lt;BR /&gt;&lt;BR /&gt;Colin&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 04:33:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201313#M8137</guid>
      <dc:creator>Deadstar</dc:creator>
      <dc:date>2008-03-11T04:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: HCS12 MC9S12E128 Interrupt Problem</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201314#M8138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;One thing that comes to mind is the check the vector tables in mc9s12c32.h and mc9s12e128.h just to make sure you're working with the timer channel that you think you are.&lt;BR /&gt;&lt;BR /&gt;The other thing I noticed while experimenting with the tools is that for the MC9S12C32, the memory model the CW wizard generated was small, while the memory model the CW wizard generated for the MC9S12E128 was banked. If you're using banked memory, you need to ensure that your interrupt lands in non-banked memory by bracketing its code with:&lt;BR /&gt;&lt;BR /&gt;#pragma CODE_SEG __NEAR_SEG NON_BANKED&lt;BR /&gt;&lt;BR /&gt;...isr code...&lt;BR /&gt;&lt;BR /&gt;#pragma CODE SEG_DEFAULT&lt;BR /&gt;&lt;BR /&gt;Just a thought.&lt;BR /&gt;&lt;BR /&gt;---Tom&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Mar 2008 23:54:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/HCS12-MC9S12E128-Interrupt-Problem/m-p/201314#M8138</guid>
      <dc:creator>J2MEJediMaster</dc:creator>
      <dc:date>2008-03-11T23:54:51Z</dc:date>
    </item>
  </channel>
</rss>

