<?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: MC9S12DG256B Timer Interrupt</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166869#M5444</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;65536 of what? Timer ticks or count variable increments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you set up vector table entry for timer overflow interrupt?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Dec 2010 16:00:04 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2010-12-03T16:00:04Z</dc:date>
    <item>
      <title>MC9S12DG256B Timer Interrupt</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166868#M5443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm a learning student currently working with the MC9S12DG256B in codewarrior, and I have a few questions in regards of interrupts in C.&lt;/P&gt;&lt;P&gt;&amp;nbsp;Down below there is a program I found out that basically use the timer overflow to interrupt and increment count everytime it sees an overflow. The main problem is the program hangs up after 65536, I wanna know if there is something else that I need to configure to get this working.&lt;/P&gt;&lt;P&gt;THX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include &amp;lt;hidef.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* common defines and macros */&lt;BR /&gt;#include &amp;lt;mc9s12dg256.h&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* derivative information */&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#pragma LINK_INFO DERIVATIVE "mc9s12dg256b"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;volatile unsigned int count;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&amp;nbsp; /* put your own code here */&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; TSCR1=0X80;//enable timer&lt;BR /&gt;&amp;nbsp; TSCR2=0x80;&amp;nbsp; //select prescler bus&lt;BR /&gt;&amp;nbsp; TFLG2=0x80;// clear timer flag&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; EnableInterrupts;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; for(;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;BR /&gt;&amp;nbsp; {&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; } /* wait forever */&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#pragma CODE_SEG NON_BANKED&lt;BR /&gt;&lt;BR /&gt;interrupt void _Timerovf(void)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;TFLG2 = 0x80;// clear the interrupt flag&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;count++; //increment counter&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;}&amp;nbsp; &amp;nbsp;&lt;BR /&gt;#pragma CODE_SEG DEFAULT&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 03:11:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166868#M5443</guid>
      <dc:creator>Josrodmar</dc:creator>
      <dc:date>2010-12-03T03:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12DG256B Timer Interrupt</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166869#M5444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;65536 of what? Timer ticks or count variable increments?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you set up vector table entry for timer overflow interrupt?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 16:00:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166869#M5444</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-12-03T16:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12DG256B Timer Interrupt</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166870#M5445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi dear,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Firstly, try to understand the module properly by going through the datasheet for timer system.&lt;/P&gt;&lt;P&gt;There&amp;nbsp;are vector numbers associated with every interrupt and it&amp;nbsp; is 16 for timeroverflow.You can write it in the fashion below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;interrupt 16 void ISR_TIMOVF(void)&lt;/P&gt;&lt;P&gt;Also keep in mind that hexadecimal system 0x00 shall be followed while configuring the registers, However,&amp;nbsp;individual bits can be set .&lt;/P&gt;&lt;P&gt;One more thing, it is not just enough to include a&amp;nbsp;word EnableInterrupts but&amp;nbsp;set the timer interrupt bit.&lt;/P&gt;&lt;P&gt;For more on this timing system, refer Embedded Systems-Design and Application for 68HC12 and HCS12 book by Steven F Barret and Daniel J Pack.&lt;/P&gt;&lt;P&gt;ALL THE BEST !&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Dec 2010 16:58:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12DG256B-Timer-Interrupt/m-p/166870#M5445</guid>
      <dc:creator>vishaka_maithil</dc:creator>
      <dc:date>2010-12-15T16:58:41Z</dc:date>
    </item>
  </channel>
</rss>

