<?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: S12XE TIM Output Compare Set and Clear Pins</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647219#M13730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ladislav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You wrote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I am not sure what you want to say here because PTT is not a port for TIM. It is PP.&lt;BR /&gt;&amp;nbsp;Moreover, writing to timer port when OC is enabled has no meaning. In this case you have to use CFORC register&lt;BR /&gt;&amp;nbsp;with proper compare action setup. - LAMA&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I am not trying to directly write to the port pins in the interrupt. I forgot to delete&amp;nbsp; "PTT = 0x00;" Sorry..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the output compare interrupt, to set and clear the pin PR0 on Port R. I added the following and I still do not get any output on PR0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIM_CFORC = 0x01;&amp;nbsp;&amp;nbsp; // Force Output Compare Action for Channel 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Sep 2016 06:59:09 GMT</pubDate>
    <dc:creator>rayhall</dc:creator>
    <dc:date>2016-09-27T06:59:09Z</dc:date>
    <item>
      <title>S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647216#M13727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use TIM to charge and then discharge an ignition coil. I have spent many hours trying to get the output compare to work. All the examples I can find toggle the pin on compare. None show how to set and clear the pins.&lt;/P&gt;&lt;P&gt;What I required&amp;nbsp; is to enable the OC to interrupt in the future to set the pin. In the interrupt the next interrupt period is set to clear the pin.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached my attempt that will do this only one time.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please do not mark this question as "presumed answered" until I have confirmed this to be true.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338970"&gt;TIM_OutputCompare.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Sep 2016 23:39:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647216#M13727</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-09-24T23:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647217#M13728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am going to prepare you an example with TIM.&lt;/P&gt;&lt;P&gt;However, if I were you I would use for this kind of a task I would use a PIT timer.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 08:51:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647217#M13728</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2016-09-26T08:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647218#M13729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So,&lt;/P&gt;&lt;P&gt;I see the issue in the port routing.&lt;/P&gt;&lt;P&gt;I have adjusted your code. The pronciple you use is OK. I can see correct behaviour at the scope.&lt;/P&gt;&lt;P&gt;Please search for keyword LAMA to see what I changed/added in/to the code.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Sep 2016 12:47:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647218#M13729</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2016-09-26T12:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647219#M13730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ladislav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You wrote&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;I am not sure what you want to say here because PTT is not a port for TIM. It is PP.&lt;BR /&gt;&amp;nbsp;Moreover, writing to timer port when OC is enabled has no meaning. In this case you have to use CFORC register&lt;BR /&gt;&amp;nbsp;with proper compare action setup. - LAMA&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I am not trying to directly write to the port pins in the interrupt. I forgot to delete&amp;nbsp; "PTT = 0x00;" Sorry..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want the output compare interrupt, to set and clear the pin PR0 on Port R. I added the following and I still do not get any output on PR0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TIM_CFORC = 0x01;&amp;nbsp;&amp;nbsp; // Force Output Compare Action for Channel 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 06:59:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647219#M13730</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-09-27T06:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647220#M13731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;could you please send me all numbers and text you can see on the top of the device.&lt;/P&gt;&lt;P&gt;Have you check functionality of the PTR.0 n the GPIO mode?&lt;/P&gt;&lt;P&gt;Just set:&lt;/P&gt;&lt;P&gt;DDRR_DDRR0 = 1; // set pn as an output&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 1;&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 0;&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 1;&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then just step the code through instructions and check whether you are on the correct pin.&lt;/P&gt;&lt;P&gt;(I do not have 208 MAPBGA device so I had to route the TIM to the port P. I spent 2 hours trying to find why I do not have signal on PP0 because I forgot to route the TIM 0 to port P)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you able to test the code I sent to you and look whether port P0 is working well?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 09:55:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647220#M13731</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2016-09-27T09:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647221#M13732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ladislav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I setup the Output Compare to toggle on Interrupt I get output on pin PR0. Also if I do what you ask I also get an output on the pin.&lt;/P&gt;&lt;P&gt;The text on the chip is S12XEP100CVL It is the 205 pin BGA version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2016 21:38:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647221#M13732</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-09-27T21:38:17Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647222#M13733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ladislav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;DDRR_DDRR0 = 1; // set pn as an output&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 1;&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 0;&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 1;&lt;/P&gt;&lt;P&gt;PTR_PTR0 = 0;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This gives no output on pin PR0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works and turns the output on and off.&lt;/P&gt;&lt;P&gt;DDRR = 0x01;&lt;BR /&gt;PTR = 0x01;&lt;/P&gt;&lt;P&gt;PTR = 0x00;&lt;/P&gt;&lt;P&gt;PTR = 0x01;&lt;/P&gt;&lt;P&gt;PTR = 0x00;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Sep 2016 08:31:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647222#M13733</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-09-28T08:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: S12XE TIM Output Compare Set and Clear Pins</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647223#M13734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ladislav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I now have it working !!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem was the PIT interrupt was not working. For some reason, the changes you made to the PIT stopped it working, so the tickTimer in the main loop was never used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have cleaned up the code and have attached the files. I am sure it would be helpful to others if NXP made an example or modified my code and made it available. For me it has been two weeks of trying to get it to work. An example would have been so helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ray.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Sep 2016 09:01:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12XE-TIM-Output-Compare-Set-and-Clear-Pins/m-p/647223#M13734</guid>
      <dc:creator>rayhall</dc:creator>
      <dc:date>2016-09-29T09:01:43Z</dc:date>
    </item>
  </channel>
</rss>

