<?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: MC9S12NE64 timers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177919#M6320</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;#include &amp;lt;MC9S12NE64.h&amp;gt;     /* derivative information */#include "lib.h"#include "Cpu.h"static long absoluteTime = 0;static long absoluteTimeUp = 0;static long msDelai = 0;static int b=1;static void startTimeBase(void){  absoluteTime = 0;  msDelai=500;  absoluteTimeUp=absoluteTime+msDelai;  }volatile unsigned int count;#pragma CODE_SEG NON_BANKEDinterrupt void _Vtimovf (void) { int i =0; absoluteTime++;                  //i=setPortPinValue('g', 0, ON); TFLG2 = 0x80;// clear the interrupt flag   count++; //increment counter   }   #pragma CODE_SEG DEFAULTvoid main(void) {int i =0;  /* put your own code here */   TSCR1=0X80;//enable timer   TSCR2=0x85;  //select prescler bus clock/32  TFLG2=0x80;// clear timer flag    i=setPortPinDirection('g', 0, OUTPUT);  i=setPortPinDirection('h', 0, INPUT);  PTG_PTG0 =1;  //i=setPortPinValue('g', 0, OFF);  startTimeBase();  EnableInterrupts;   while(1)   {    while(absoluteTimeUp&amp;gt;absoluteTime)    {   }         absoluteTime=0;      if(b==0)       {        b=1;                i=setPortPinValue('g', 0, OFF);      }      else       {        b=0;                i=setPortPinValue('g', 0, ON);      }               } /* wait forever */}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2020 09:27:05 GMT</pubDate>
    <dc:creator>Mampaey</dc:creator>
    <dc:date>2020-10-29T09:27:05Z</dc:date>
    <item>
      <title>MC9S12NE64 timers</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177917#M6318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have many problems with timers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could someone tell me what I have to do to have a timer wich reset and works forever, with interrupts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 00:12:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177917#M6318</guid>
      <dc:creator>Mampaey</dc:creator>
      <dc:date>2010-02-22T00:12:56Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12NE64 timers</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177918#M6319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should probably post your code in order for us to help you.&amp;nbsp; Also, you might want to look at &lt;A href="http://users.ece.utexas.edu/~valvano/Starterfiles/" rel="nofollow" target="_blank"&gt;http://users.ece.utexas.edu/~valvano/Starterfiles/&lt;/A&gt; which has plenty of starter code for timers if you search for "output compare" on the page.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 00:16:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177918#M6319</guid>
      <dc:creator>isionous</dc:creator>
      <dc:date>2010-02-22T00:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12NE64 timers</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177919#M6320</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;#include &amp;lt;MC9S12NE64.h&amp;gt;     /* derivative information */#include "lib.h"#include "Cpu.h"static long absoluteTime = 0;static long absoluteTimeUp = 0;static long msDelai = 0;static int b=1;static void startTimeBase(void){  absoluteTime = 0;  msDelai=500;  absoluteTimeUp=absoluteTime+msDelai;  }volatile unsigned int count;#pragma CODE_SEG NON_BANKEDinterrupt void _Vtimovf (void) { int i =0; absoluteTime++;                  //i=setPortPinValue('g', 0, ON); TFLG2 = 0x80;// clear the interrupt flag   count++; //increment counter   }   #pragma CODE_SEG DEFAULTvoid main(void) {int i =0;  /* put your own code here */   TSCR1=0X80;//enable timer   TSCR2=0x85;  //select prescler bus clock/32  TFLG2=0x80;// clear timer flag    i=setPortPinDirection('g', 0, OUTPUT);  i=setPortPinDirection('h', 0, INPUT);  PTG_PTG0 =1;  //i=setPortPinValue('g', 0, OFF);  startTimeBase();  EnableInterrupts;   while(1)   {    while(absoluteTimeUp&amp;gt;absoluteTime)    {   }         absoluteTime=0;      if(b==0)       {        b=1;                i=setPortPinValue('g', 0, OFF);      }      else       {        b=0;                i=setPortPinValue('g', 0, ON);      }               } /* wait forever */}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is my code&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:27:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177919#M6320</guid>
      <dc:creator>Mampaey</dc:creator>
      <dc:date>2020-10-29T09:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12NE64 timers</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177920#M6321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What do you want the code to do and what does the code actually do?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One suggestion so far, make your global variables volatile since they are being used by more than one thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 15:48:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177920#M6321</guid>
      <dc:creator>isionous</dc:creator>
      <dc:date>2010-02-22T15:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12NE64 timers</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177921#M6322</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;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code should make a LED twinkle.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact, the LED isn't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 17:05:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177921#M6322</guid>
      <dc:creator>Mampaey</dc:creator>
      <dc:date>2010-02-22T17:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12NE64 timers</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177922#M6323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why then i=setPortPinValue('g', 0, ON); line is commented out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you initialize interrupt vectors table properly? Is there some dedicated *.c module with interrupts table defined? Maybe&amp;nbsp;set interrupt vectors in *.prm file? If not then you should change timer overflow ISR like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;interrupt &lt;STRONG&gt;VectorNumber_Vtimovf&lt;/STRONG&gt; void _Vtimovf (void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Feb 2010 18:12:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12NE64-timers/m-p/177922#M6323</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2010-02-22T18:12:57Z</dc:date>
    </item>
  </channel>
</rss>

