<?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: Using TPMCH0 on S08 MCU as a Counter from external square signal source in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274785#M20201</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it is still waiting for virus scan. Please take a look in a little while...&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;/Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Apr 2013 20:22:44 GMT</pubDate>
    <dc:creator>CarlosCasillas</dc:creator>
    <dc:date>2013-04-18T20:22:44Z</dc:date>
    <item>
      <title>Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274782#M20198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello colleagues!&lt;/P&gt;&lt;P&gt;I'm a starter in MCU programming.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm in a project where I need to use S08 pin TPMCH0 as an&lt;BR /&gt;external square signal input, and count the number of pulses there. I selected&lt;BR /&gt;a Capture component in CW, but unfortanetly couldn't neither configure nor&lt;BR /&gt;create a C code to get the count on this TPM register. When I try to set Reset&lt;BR /&gt;and Get commands, compiling returns me a lot of errors regarding de arguments&lt;BR /&gt;and definitions I couldn't resolve.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Do you have a clear example of how to handle this issue,&lt;BR /&gt;I mean, a file with examples of similar applications, or could you guide me in&lt;BR /&gt;how to resolve this situation?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for your quick response and knowledge.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eduardo Buezas&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 13:20:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274782#M20198</guid>
      <dc:creator>eduardobuezas</dc:creator>
      <dc:date>2013-04-18T13:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274783#M20199</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hello Eduardo,&lt;/P&gt;&lt;P&gt;I have attached to this post an example project for CodeWarrior v10.x which configures TPM1CH0 of MC9S08SH8 MCU for Input Capture mode. The Input Capture and Timer overflow interrupts are declared and serviced, and you could add your custom code inside the functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will be useful for you.&lt;BR /&gt;Best regards!&lt;/P&gt;&lt;P&gt;/Carlos&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 20:09:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274783#M20199</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2013-04-18T20:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274784#M20200</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Carlos, I didn't found the attached example....&lt;/P&gt;&lt;P&gt;I would appreciate if you could send me it&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 20:18:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274784#M20200</guid>
      <dc:creator>eduardobuezas</dc:creator>
      <dc:date>2013-04-18T20:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274785#M20201</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Maybe it is still waiting for virus scan. Please take a look in a little while...&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;/Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 20:22:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274785#M20201</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2013-04-18T20:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274786#M20202</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nothing. I'm new in this forum. Where should it be? I guess with your post here in the forum.&lt;/P&gt;&lt;P&gt;In my email inbox either, there is nothing attached.&lt;/P&gt;&lt;P&gt;Could you send it again?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 20:54:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274786#M20202</guid>
      <dc:creator>eduardobuezas</dc:creator>
      <dc:date>2013-04-18T20:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274787#M20203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. Yes, it is an attachment on the post, and you can find the discussion at the following link:&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/306448" title="https://community.freescale.com/thread/306448"&gt;https://community.freescale.com/thread/306448&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;/Carlos&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 21:00:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274787#M20203</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2013-04-18T21:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274788#M20204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I was not at that link. Now I got it. I'll try and let you know&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 21:11:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274788#M20204</guid>
      <dc:creator>eduardobuezas</dc:creator>
      <dc:date>2013-04-18T21:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274789#M20205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You made the code in assembler or C?&lt;/P&gt;&lt;P&gt;I didn't find a .mcp file in the zip you sent.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 21:34:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274789#M20205</guid>
      <dc:creator>eduardobuezas</dc:creator>
      <dc:date>2013-04-18T21:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274790#M20206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is for C, but doesn't include a .mcp file because it is for CodeWarrior 10.x (Eclipse). If you don't have CW 10.x, you could just open the main.c file on a text editor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards!&lt;/P&gt;&lt;P&gt;/Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Apr 2013 21:42:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274790#M20206</guid>
      <dc:creator>CarlosCasillas</dc:creator>
      <dc:date>2013-04-18T21:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using TPMCH0 on S08 MCU as a Counter from external square signal source</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274791#M20207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Eduardo,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The use of TPM input capture mode is usually applicable to when the period between input pulses needs to be measured.&amp;nbsp; However, it would seem that your specific requirement is to measure the number of incoming pulses only.&amp;nbsp; You would therefore need to separately count the number of input capture events occurring using a separate counter global variable.&amp;nbsp; For each input capture interrupt, the counter would be incremented within the ISR.&amp;nbsp; The TPM channel register does not provide useful information for your specific requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An alternative approach would be to feed the input pulses to the TCLK input of the TPM module.&amp;nbsp; For this case, the TPM counter register would provide a count of the number of pulses received since the register was last zeroed.&amp;nbsp; It is simply a matter of reading the register - the channels associated with the particular TPM module are not used.&amp;nbsp; With this method interrupts are not necessary unless you require to handle large count values where TPM overflow can occur. Of course, the prescale divider for the TPM will need to be set for divide by one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either approach can be made to work.&amp;nbsp; If you require to make use of other channels associated with the TPM module, you would use the input capture count method.&amp;nbsp; If not, using the external clock input would be simpler, and requires fewer interrupts, if any.&lt;/P&gt;&lt;P&gt;&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>Fri, 19 Apr 2013 07:03:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-TPMCH0-on-S08-MCU-as-a-Counter-from-external-square-signal/m-p/274791#M20207</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2013-04-19T07:03:12Z</dc:date>
    </item>
  </channel>
</rss>

