<?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: MC1321X Interrupt question. in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182716#M13458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bigmac, I appreciate your help. I understand what you said about the TPM1C0SC_CHOF, I don't know why it was there. I have also changed the code to use &lt;FONT face="courier new,courier"&gt;TPM1C0V += E_PER_MS.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCUInit() function is found in mcu_hw_config.c from Freescale. I have provided a copy of the MCUInit() function. I have also provided a copy of the vector table in the attachment. I don't know what is meant by the ISR macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also provided a copy of OCDlyInit which initializes the TPM1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still don't know why it will not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for helping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 May 2009 00:41:13 GMT</pubDate>
    <dc:creator>Warren_Weigel</dc:creator>
    <dc:date>2009-05-21T00:41:13Z</dc:date>
    <item>
      <title>MC1321X Interrupt question.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182714#M13456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I using the MC13213NCB and I cannot seem to get interupts to work. I am trying to use TPM1 Channel 0 to generate an interupt to increment a counter and use that counter to time a time slice. I have added the vector to the vector table and when I look at the memory when a breakpoint is reached the correct initiated values are loaded into register x35. It seems no matter what I do it will not signal the interupt, so my code just waits until the counter reaches a value, but it is always 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I startup the microcontoller I initialize the delay timer and the interrupts.When I run the program it stops at the while loop in the attached code. When I reference ENABLE_INT(), it is defined as "asm cli".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some sort of initialization I am forgetting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 08:10:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182714#M13456</guid>
      <dc:creator>Warren_Weigel</dc:creator>
      <dc:date>2009-05-20T08:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: MC1321X Interrupt question.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182715#M13457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Warren, and welcome to the forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You have not shown the code that initialises the TPM module operation. This might possibly be within the MCUinit() function.&amp;nbsp; Your problem could be within this code.&amp;nbsp; Additionally, what method did you use to implement your ISR function within the vector table?&amp;nbsp; What is the definition of the ISR macro?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The ENABLE_INT() macro provides the global enabling of all the individual interrupts that have been enabled within initialisation process for each module.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While not associated with your current problem, a couple of further comments about your ISR code -&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The expression &lt;FONT face="courier new,courier"&gt;TPM1C0SC_CH0F = 0;&lt;/FONT&gt;&amp;nbsp; that controls a specific bit, actually provides read-modify-write code.&amp;nbsp; So the separate expression to read the flag is unnecessary.&lt;/LI&gt;&lt;LI&gt;To increment the channel register, I would tend to use the expression &lt;FONT face="courier new,courier"&gt;TPM1C0V += E_PER_MS;&lt;/FONT&gt;&amp;nbsp; This will avoid cumulative timing errors due to any latency in executing the ISR code.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 May 2009 13:37:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182715#M13457</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2009-05-20T13:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: MC1321X Interrupt question.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182716#M13458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;bigmac, I appreciate your help. I understand what you said about the TPM1C0SC_CHOF, I don't know why it was there. I have also changed the code to use &lt;FONT face="courier new,courier"&gt;TPM1C0V += E_PER_MS.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCUInit() function is found in mcu_hw_config.c from Freescale. I have provided a copy of the MCUInit() function. I have also provided a copy of the vector table in the attachment. I don't know what is meant by the ISR macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have also provided a copy of OCDlyInit which initializes the TPM1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I still don't know why it will not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again for helping.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 May 2009 00:41:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182716#M13458</guid>
      <dc:creator>Warren_Weigel</dc:creator>
      <dc:date>2009-05-21T00:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: MC1321X Interrupt question.</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182717#M13459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I was able to get it working. The OCDlyInit() function was setting the right clockA:clockB value, but MCUInit() was setting it to x00. I switched the order of the two and it runs.&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>Thu, 21 May 2009 06:44:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC1321X-Interrupt-question/m-p/182717#M13459</guid>
      <dc:creator>Warren_Weigel</dc:creator>
      <dc:date>2009-05-21T06:44:07Z</dc:date>
    </item>
  </channel>
</rss>

