<?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: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336762#M10474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, toggle on overflow doesn't trigger additional OC interrupts and doesn't change contents of TCx registers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding input capture problems. Measure long time periods algorithm from MC68HC11RM.pdf needs reading input capture timer value and reading timer overflow flag from input capture ISR. I see something in your code verifying the sign or MSB of timer capture value, but where's is a check for overflow flag? 2nd is also important.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 08 Aug 2014 05:17:08 GMT</pubDate>
    <dc:creator>kef2</dc:creator>
    <dc:date>2014-08-08T05:17:08Z</dc:date>
    <item>
      <title>Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336755#M10467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had the following code, which worked just fine before I assigned the over-flow ISR to XGATE. I'm using 800ns ticks.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;/* code that is part of an IC ISR */ &amp;nbsp;&amp;nbsp; LongTime timeStamp; &amp;nbsp;&amp;nbsp;&amp;nbsp; /* Install the low word */ &amp;nbsp;&amp;nbsp;&amp;nbsp; timeStamp.timeShorts[1] = edgeTimeStamp; &amp;nbsp;&amp;nbsp;&amp;nbsp; /* Find out what our timer value means and put it in the high word */ &amp;nbsp;&amp;nbsp;&amp;nbsp; if(TFLGOF &amp;amp;&amp;amp; !(edgeTimeStamp &amp;amp; 0x8000)){&amp;nbsp;&amp;nbsp;&amp;nbsp; /*see 68hc11 ref manual for details */ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeStamp.timeShorts[0] = timerExtensionClock + 1; &amp;nbsp;&amp;nbsp;&amp;nbsp; }else{ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeStamp.timeShorts[0] = timerExtensionClock; &amp;nbsp;&amp;nbsp;&amp;nbsp; } &amp;nbsp;&amp;nbsp;&amp;nbsp; unsigned long thisEventTimeStamp = timeStamp.timeLong; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Due to new product requirements, XGATE now handles the timer-overflow ISR as well as some OC ISRs:&lt;/P&gt;&lt;PRE class="plain" name="code"&gt;xgateTOFISR:&amp;nbsp;&amp;nbsp; &amp;nbsp; TOFISRSEM: &amp;nbsp; SSEM #1 ; try to lock semaphore &amp;nbsp; BCC TOFISRSEM; retry until locked&amp;nbsp;&amp;nbsp; ;Increment the metronome request to trigger the s12 to run metronome(); &amp;nbsp; LDW R7, metronomeRequestCount &amp;nbsp; LDW R6, (R7, #0) &amp;nbsp; ADDL R6, #1 &amp;nbsp; STW R6, (R7, #0)&amp;nbsp;&amp;nbsp; ;Clear timer overflow interrupt flag &amp;nbsp; LDL R7, #TFLGOF &amp;nbsp; LDL R6, #0x80 &amp;nbsp; STB R6, (R7, #0)&amp;nbsp;&amp;nbsp; &amp;nbsp; CSEM #1 ;Release semaphore&amp;nbsp;&amp;nbsp; RTS &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;and in my NEW&amp;nbsp; S12 ISR:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;do { &amp;nbsp; XGSEM = 0x0202; } while ((XGSEM &amp;amp;= BIT1) == 0);&amp;nbsp;&amp;nbsp; timeStamp.timeShorts[0] = timerExtensionClock; XGSEM = 0x0200; //Clear semaphore 1 by writing mask=1 and flag=0 &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that I often get bogus results when I diff the previous time-stamp. It's obvious that there are times when an over-flow is not correctly being accounted for. What's not so obvious is how to solve this.&amp;nbsp; Any input would be appriciated.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 15:54:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336755#M10467</guid>
      <dc:creator>seank</dc:creator>
      <dc:date>2014-08-05T15:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336756#M10468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, line: &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;LDW R7, metronomeRequestCount &lt;/SPAN&gt; should read &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;LDW R7,&lt;/SPAN&gt; &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;timerExtensionClock .&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was attempting to create a delay-stage in which s12 had to increment a non-shared variable, which helped quit a bit, but did not work 100% of the time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2014 15:57:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336756#M10468</guid>
      <dc:creator>seank</dc:creator>
      <dc:date>2014-08-05T15:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336757#M10469</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;I don't see a lot of sense in moving such short and very low frequency TOF ISR to XGATE, but I guess you know what are you doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should work with no problems, provided semaphores are locked and released at appropriate times. I don't see whole ISR's and thus can't say whether you do it properly or not. You need to semaphore protect not only accesses to shared variables, but also to timer channel register and timer flags register. It is required to make original HC11 algorithm working. Timer channel and flags registers are kind of indirectly shared variables in original HC11 algorithm...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;} &lt;/SPAN&gt;&lt;SPAN style="color: #006699;"&gt;&lt;SPAN class="keyword"&gt;while&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; ((XGSEM &amp;amp;= BIT1) == &lt;/SPAN&gt;&lt;SPAN style="color: #008000;"&gt;&lt;SPAN class="number"&gt;0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;);&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&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;&amp;nbsp; ^^&amp;nbsp; looks like you do write access to XGSEM here. But what for?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 06:28:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336757#M10469</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-08-06T06:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336758#M10470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What I have is one OC channel that generates 24 precision pulse-widths via xgate bit bang code(fuel and ignition controller for gasoline engines). The only method I have thought of to do this, requires immediate servicing of the overflow ISR. I need to retain 1-2 uS accuracy/jitter.&amp;nbsp; The S12 core does the math required for the correct PW and placement of the PW, then it's xgates job to make sure it all happens in real-time. It's a foss project and I'll post the code soon, in case you or anyone else has any input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;"} &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #006699;"&gt;&lt;SPAN class="keyword" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;while&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt; ((XGSEM &amp;amp;= BIT1) == &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #008000;"&gt;&lt;SPAN class="number" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;0&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #000000;"&gt;);"&amp;nbsp; Yep, that's one issue,&amp;nbsp; should be !(XGSEM &amp;amp; BIT1).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also did not know that register access needed to be protected. Let me correct these two issues and rerun my tests.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Aug 2014 15:37:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336758#M10470</guid>
      <dc:creator>seank</dc:creator>
      <dc:date>2014-08-06T15:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336759#M10471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Measuring long periods (taking more than 2^16 timer ticks) requires using timer overflow interrupt. But you don't need timer overflow interrupt to generate long delays.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of using overflow interrupt, you can use the same output compare channel to count overflows. In ISR you need to update overflow counter and clear timer channel flag and ISR will trigger again after about 2^16 timer ticks.&lt;/P&gt;&lt;P&gt;So to generate for example 0x21234 ticks delay you set up TCx = TCNT + (0x21234 % 0x10000) and execute TCx ISR&amp;nbsp; 0x21234 / 0x10000 = 2 times. Each time ISR is called, you need to clear timer flag and update overflows counter. 2nd (last) time ISR is executed you disable channel interrupt and set up timer pin for proper output compare action on 3rd output compare. So you have 3 OC intervals 0x1234+0x10000+0x10000=0x21234. Simple, but there's one problem. In case ticks % 0x10000 is about or less the interrupt latency limit, you need to do something special. For example you need to generate 0x20015 ticks delay and interrupt latency is say 0x30 or more timer ticks:&lt;/P&gt;&lt;P&gt;Setting TCx = TCNT + 0x15 is a bad idea and won't work. But you may take one overflow interval, add to it this small 0x15 value and divide the sum into two nonequal parts. So instead of setting up TCx = TCNT + 0x15 and executing ISR two times with TCx fixed, you may set TCx = TCNT + 0x8015 and execute ISR again two times, like in 0x21234 case, but changing TCx = TCx + 0x8000 on first ISR call. So you again have 3 OC intervals 0x8015+0x8000+0x10000=0x20015.&lt;BR /&gt;I hope above is clear. I'm using this technique a lot to generate jitterless long and short pulses with best possible timer resolution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 06:46:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336759#M10471</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-08-07T06:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336760#M10472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the tip. I'll rethink some things.&amp;nbsp; I'm trying to bit-bang 24 individual port pins(channels), sometimes they overlap or occur right next to each other . It's not that I'm trying to generate long periods, I'm trying to use a cheap method to figure out what events are next and which ones may be late. All of that works decently but requires me to handle the overflow interrupt in xgate, which as I stated created a new problem in my S12 IC ISR. Let me see if your suggestions sparks some new ideas.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a different note, making those mutex changes did not fix the problem. Here is what almost works(1000x less bogus input capture stamps), but I'm not sure why.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;do {&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp; XGSEM = 0x0202;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;} while (!(XGSEM &amp;amp; BIT1));&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;if(((timerExtensionClock != timerExtensionClockShared) &amp;amp;&amp;amp; !(edgeTimeStamp &amp;amp; 0x8000))) {&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt; timeStamp.timeShorts[0] = timerExtensionClock + 1;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;}else{&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timeStamp.timeShorts[0] = timerExtensionClock;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;TABLE style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;XGSEM = 0x0200; //Clear semaphore 1 by writing mask=1 and flag=0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;timerExtensionClock, is not a shared variable, it gets updated in an S12 RTI interrupt that runs every 10uS. Why does this work so much better, but not 100% of the time?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void RTIISR(){&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Clear the RTI flag */&lt;/P&gt;&lt;P&gt;&amp;nbsp; CRGFLG = 0x80;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; do {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; XGSEM = 0x0202;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } while (!(XGSEM &amp;amp; BIT1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if (timerExtensionClock != timerExtensionClockShared) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; metronome();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGSEM = 0x0200; //Clear semaphore 1 by writing mask=1 and flag=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;///metronome()&lt;/P&gt;&lt;P&gt;do {&lt;/P&gt;&lt;P&gt;&amp;nbsp; XGSEM = 0x0202;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } while (!(XGSEM &amp;amp; BIT1));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; timerExtensionClock = timerExtensionClockShared; // bring s12 timer extension up to date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;XGSEM = 0x0200; //Clear semaphore 1 by writing mask=1 and flag=0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://powerefi.com/files/operation.txt"&gt;http://powerefi.com/files/operation.txt&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 16:13:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336760#M10472</guid>
      <dc:creator>seank</dc:creator>
      <dc:date>2014-08-07T16:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336761#M10473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Field Description&lt;/P&gt;&lt;P&gt;7:0 Toggle On Overflow Bits — TOV97:0] toggles output compare pin on timer counter overflow. This feature only&lt;/P&gt;&lt;P&gt;TOV[7:0] takes effect when in output compare mode. When set, it takes precedence over forced output compare but not&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; channel 7 override events.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 Toggle output compare pin on overflow feature disabled.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1 Toggle output compare pin on overflow feature enabled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does that also trigger the ISR for that timer channel? And if so does it change the contents of the OC register?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sean&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2014 19:53:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336761#M10473</guid>
      <dc:creator>seank</dc:creator>
      <dc:date>2014-08-07T19:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Measuring Long Periods via Timer Over-Flow Flag Trick.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336762#M10474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No, toggle on overflow doesn't trigger additional OC interrupts and doesn't change contents of TCx registers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding input capture problems. Measure long time periods algorithm from MC68HC11RM.pdf needs reading input capture timer value and reading timer overflow flag from input capture ISR. I see something in your code verifying the sign or MSB of timer capture value, but where's is a check for overflow flag? 2nd is also important.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 05:17:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Measuring-Long-Periods-via-Timer-Over-Flow-Flag-Trick/m-p/336762#M10474</guid>
      <dc:creator>kef2</dc:creator>
      <dc:date>2014-08-08T05:17:08Z</dc:date>
    </item>
  </channel>
</rss>

