<?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: MC9S12C32 Output Compare interrupt works in CodeWarrior debug mode not NanoCore12 run mode. in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181678#M6642</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Are you trying to reset TCNT register to zero by writing it? It's possible only in special modes.&lt;/DIV&gt;&lt;DIV&gt;Also it could by some&amp;nbsp;write once register. You may write it once per MCU reset in normal mode, but write many times in special modes.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 22 Jan 2008 12:54:30 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2008-01-22T12:54:30Z</dc:date>
    <item>
      <title>MC9S12C32 Output Compare interrupt works in CodeWarrior debug mode not NanoCore12 run mode.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181677#M6641</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3;"&gt;I am using CodeWarrior with a MC9S12C32 in a Technological Arts NanoCore12 board.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; The problem I am having is with output compare interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style=": ; color: #000000; font-size: 3;"&gt;When I run a program from CodeWarrior Debug-&amp;gt;(F5) using HCS12_Serial_Monitor the program and interrupt operates correctly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-size: 3;"&gt;When I run the program&amp;nbsp;in the NanoCore12 boards run mode the interrupt routine &lt;STRONG&gt;does not&lt;/STRONG&gt; function but the remaining code does functions correctly.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; Any suggestions.&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 11:55:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181677#M6641</guid>
      <dc:creator>bhansen</dc:creator>
      <dc:date>2008-01-22T11:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12C32 Output Compare interrupt works in CodeWarrior debug mode not NanoCore12 run mode.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181678#M6642</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Are you trying to reset TCNT register to zero by writing it? It's possible only in special modes.&lt;/DIV&gt;&lt;DIV&gt;Also it could by some&amp;nbsp;write once register. You may write it once per MCU reset in normal mode, but write many times in special modes.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 12:54:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181678#M6642</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-01-22T12:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12C32 Output Compare interrupt works in CodeWarrior debug mode not NanoCore12 run mode.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181679#M6643</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;The interrupt routine is a milli second timer.&amp;nbsp; I monitor this time to perform various tasks, lets say output a pin.&amp;nbsp; Works fine using CW debug, not when run from NanoCore run mode.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;void setup_int(void){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* set up timer 7 modulus compare up counter interrupt routine*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; DisableInterrupts;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TC7 = 375;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* load compare count (time_delay) timer 7*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TIE = 0b10000000;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* enable interrupt for timer 7*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TSCR1 = 0b10000000;&amp;nbsp; /* starts main timer TCNT with manual compare match flag rest*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TSCR2= 0b00001110;&amp;nbsp;&amp;nbsp; /* select TC7 reload to TCNT on compare equal with 64 prescaler*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;TIOS |= 0b10000000;&amp;nbsp;&amp;nbsp; /* enable timer 7 for output compare*/&lt;BR /&gt;&amp;nbsp; &amp;nbsp;mscount=0;&lt;BR /&gt;&amp;nbsp; EnableInterrupts;&lt;BR /&gt;}&lt;/DIV&gt;&lt;DIV&gt;/* interrupt routine for timer 7 interrupt 15 */&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;interrupt 15 void ms_count(void){&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; mscount++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* inc timer by 1 */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TFLG1 |= 0b10000000;&amp;nbsp; /* clear timer 7 interrupt flag*/&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; TFLG2 |= 0b10000000;&amp;nbsp; /* clear TOF flag of TCNT*/&lt;BR /&gt;}&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 13:12:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181679#M6643</guid>
      <dc:creator>bhansen</dc:creator>
      <dc:date>2008-01-22T13:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12C32 Output Compare interrupt works in CodeWarrior debug mode not NanoCore12 run mode.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181680#M6644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Looks good, except two things;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;1) &lt;FONT color="#ff0000"&gt;TFLG1 |= 0b10000000;&lt;/FONT&gt; may have side effects. It will clear not only TC7 flasg, but also other TFLG1 flags.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Use &lt;FONT color="#33CC00"&gt;TFLG1 = 0b10000000;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#33CC00"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Above doesn't&amp;nbsp;break your current code, but please keep that in mind.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT color="#33CC00"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;2) As far as I know, serial monitor occupies and write protects 2kB of flash, including regular vector table at FF80-FFFF. I wonder how your code could work with serial monitor since you have&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;interrupt &lt;FONT color="#ff0000"&gt;15&lt;/FONT&gt; void ms_count(void){&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;15 is good for TC7 vector in normal vector table at FF80-FFFF. Having serial monitor installed, you should use secondary vector table at F780-F7FF. You should replace 15 with (15+1024). 1024 is the size of serial monitor divided by sizeof(vector entry)==2.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;You also should fix prm file you are currently using. It should have&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;VECTOR &lt;FONT color="#33CC00"&gt;1024&lt;/FONT&gt; _Startup&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;instead of&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;VECTOR &lt;FONT color="#ff0000"&gt;0&lt;/FONT&gt; _Startup&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;Message Edited by kef on &lt;SPAN class="date_text"&gt;2008-01-22&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;10:19 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 16:16:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181680#M6644</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2008-01-22T16:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S12C32 Output Compare interrupt works in CodeWarrior debug mode not NanoCore12 run mode.</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181681#M6645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;FONT color="#000000" size="3"&gt;The original vector address for timer 7 compare is 0xFFE0 the address with monitor installed is 0xF7E0 (the 2048 you spoke about).&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; If I look at memory address 0xF7E0 it equals 0xC166, which is the actual starting location of the interrupt 15 routine.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; I am assuming that these values are actually burned in these addresses and not simulated by the debugger.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="3"&gt;I put PTT ^= 0x01 inside the interrupt routine and pin 1 toggles when run from the CodeWarrior debug.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt; If I run the same code using run mode on NanoCore12, pin 1 stays high and does not toggle. &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Its acting like the interrupt is disabled or not being reset, I told your suggestion on resetting the flag.&amp;nbsp;&amp;nbsp;I can’t explain it.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="3"&gt;I ordered a P&amp;amp;E Multilink last night, I am going to try it without the monitor. &amp;nbsp;I am going that direction sooner or later.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000" size="3"&gt;Thanks for all your help.&lt;/FONT&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Jan 2008 12:15:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/MC9S12C32-Output-Compare-interrupt-works-in-CodeWarrior-debug/m-p/181681#M6645</guid>
      <dc:creator>bhansen</dc:creator>
      <dc:date>2008-01-23T12:15:10Z</dc:date>
    </item>
  </channel>
</rss>

