<?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のトピックInterrupt trouble MC9S12DP512</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-trouble-MC9S12DP512/m-p/191090#M7462</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am have problems with a MC9S12DP512, I am using ICC12 and using TwinPeeks&lt;BR /&gt;to load the programs.&lt;BR /&gt;&lt;BR /&gt;My question relates to the operation of the timer interrupts. I can get TC7&lt;BR /&gt;working correctly.&lt;BR /&gt;&lt;BR /&gt;But if I try and use TC0 nothing appears to happen. I believe it has&lt;BR /&gt;something to do with the redirected interrupt vectors. Mainly because of the&lt;BR /&gt;redirect vector that works for TC7 is actually that of TC0 in the manual.&lt;BR /&gt;&lt;BR /&gt;Here is a sample of my code just in case something is incorrect:&lt;BR /&gt;&lt;BR /&gt;// Setup&lt;BR /&gt;void SetTimer(unsigned int Ticks){&lt;BR /&gt;asm("sei");&lt;BR /&gt;TIOS = 0x81;&lt;BR /&gt;TIE = 0x81;&lt;BR /&gt;TSCR2 = 0x8c;&lt;BR /&gt;TC0=Ticks-1;&lt;BR /&gt;TC7 = Ticks*2;&lt;BR /&gt;TSCR1 = 0x80;&lt;BR /&gt;// Clear Timer Flag&lt;BR /&gt;TFLG1 = 0x81;&lt;BR /&gt;HPRIO = 0xEE;&lt;BR /&gt;asm("cli");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// ISR for timer 0 this is the same for timer 7&lt;BR /&gt;#pragma interrupt_handler Timer0&lt;BR /&gt;void Timer0(void){&lt;BR /&gt;PTM^=0x01; // Pulse LED&lt;BR /&gt;//putstring("abcd\n\r");&lt;BR /&gt;// Clear timer interrupt flag&lt;BR /&gt;TFLG1 = 0x01;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Within the main() function:&lt;BR /&gt;&lt;BR /&gt;//TC7&lt;BR /&gt;*((unsigned char *)0x3FE8) = 0x06; // JMP opcode&lt;BR /&gt;*((void (**)(void))0x3FE9) = Timer7;&lt;BR /&gt;&lt;BR /&gt;// TC0&lt;BR /&gt;*((unsigned char *)0x3FFD) = 0x06; // JMP opcode&lt;BR /&gt;*((void (**)(void))0x3FFE) = Timer0;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;SetTimer(200);&lt;/P&gt;&lt;P&gt;while(1){&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;BR /&gt;&lt;BR /&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added p/n to subject.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-02-19&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:08 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Feb 2008 20:22:43 GMT</pubDate>
    <dc:creator>paulwilliam</dc:creator>
    <dc:date>2008-02-19T20:22:43Z</dc:date>
    <item>
      <title>Interrupt trouble MC9S12DP512</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-trouble-MC9S12DP512/m-p/191090#M7462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am have problems with a MC9S12DP512, I am using ICC12 and using TwinPeeks&lt;BR /&gt;to load the programs.&lt;BR /&gt;&lt;BR /&gt;My question relates to the operation of the timer interrupts. I can get TC7&lt;BR /&gt;working correctly.&lt;BR /&gt;&lt;BR /&gt;But if I try and use TC0 nothing appears to happen. I believe it has&lt;BR /&gt;something to do with the redirected interrupt vectors. Mainly because of the&lt;BR /&gt;redirect vector that works for TC7 is actually that of TC0 in the manual.&lt;BR /&gt;&lt;BR /&gt;Here is a sample of my code just in case something is incorrect:&lt;BR /&gt;&lt;BR /&gt;// Setup&lt;BR /&gt;void SetTimer(unsigned int Ticks){&lt;BR /&gt;asm("sei");&lt;BR /&gt;TIOS = 0x81;&lt;BR /&gt;TIE = 0x81;&lt;BR /&gt;TSCR2 = 0x8c;&lt;BR /&gt;TC0=Ticks-1;&lt;BR /&gt;TC7 = Ticks*2;&lt;BR /&gt;TSCR1 = 0x80;&lt;BR /&gt;// Clear Timer Flag&lt;BR /&gt;TFLG1 = 0x81;&lt;BR /&gt;HPRIO = 0xEE;&lt;BR /&gt;asm("cli");&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// ISR for timer 0 this is the same for timer 7&lt;BR /&gt;#pragma interrupt_handler Timer0&lt;BR /&gt;void Timer0(void){&lt;BR /&gt;PTM^=0x01; // Pulse LED&lt;BR /&gt;//putstring("abcd\n\r");&lt;BR /&gt;// Clear timer interrupt flag&lt;BR /&gt;TFLG1 = 0x01;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Within the main() function:&lt;BR /&gt;&lt;BR /&gt;//TC7&lt;BR /&gt;*((unsigned char *)0x3FE8) = 0x06; // JMP opcode&lt;BR /&gt;*((void (**)(void))0x3FE9) = Timer7;&lt;BR /&gt;&lt;BR /&gt;// TC0&lt;BR /&gt;*((unsigned char *)0x3FFD) = 0x06; // JMP opcode&lt;BR /&gt;*((void (**)(void))0x3FFE) = Timer0;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;SetTimer(200);&lt;/P&gt;&lt;P&gt;while(1){&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated&lt;BR /&gt;&lt;BR /&gt;Paul&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Added p/n to subject.&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Message Edited by NLFSJ on &lt;/SPAN&gt;&lt;SPAN class="date_text"&gt;2008-02-19&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;07:08 AM&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 20:22:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-trouble-MC9S12DP512/m-p/191090#M7462</guid>
      <dc:creator>paulwilliam</dc:creator>
      <dc:date>2008-02-19T20:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: Interrupt trouble</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-trouble-MC9S12DP512/m-p/191091#M7463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hello,&lt;BR /&gt;i have not checked your program, but&lt;BR /&gt;i think you use the wrong addresses. Here are&lt;BR /&gt;the vectors for the 9s12D64 that i use.&lt;BR /&gt;Eggert&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fd3) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fd4) =TC7handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fd6) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fd7) =TC6handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fd9) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fda) =TC5handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fdc) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fde) =TC4handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fdf) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fe0) =TC3handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fe2) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fe3) =TC2handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fe5) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fe6) =TC1handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*((unsigned char *)0x3fe8) = 0x06;&lt;BR /&gt;*((void (**)(void))0x3fe9) =TC0handler;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;*/&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2008 21:32:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Interrupt-trouble-MC9S12DP512/m-p/191091#M7463</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2008-02-19T21:32:47Z</dc:date>
    </item>
  </channel>
</rss>

