<?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>8-bit MicrocontrollersのトピックInfo on Timer and on library creation</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147642#M7495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently use DZ60.&lt;/P&gt;&lt;P&gt;In several applications, we are interested to replace a NE555 in monostable&amp;nbsp;mode by&lt;/P&gt;&lt;P&gt;a TPM timer of the DZ60. (On our application,&amp;nbsp;when the 555 is triggered,&amp;nbsp;its output generates a&lt;/P&gt;&lt;P&gt;pulse of a pre-defined time, polarity of trigger and output is not important).&lt;/P&gt;&lt;P&gt;I've looked at the TPM but I don't see how&amp;nbsp;to create that with&amp;nbsp;a TMP timer ?&lt;/P&gt;&lt;P&gt;If any one has created that function, I'm interested.&lt;/P&gt;&lt;P&gt;With a 18 MHz MCGCLK, accuracy would be 55 ns and max pulse with could be 3.6 ms&lt;/P&gt;&lt;P&gt;with is ok for us. (With the Renesas R8C we also use, it is possible but the timer is only 8 bits wide)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a project which is a library, it compiles fine and creates a .lib file and a .lst file with the entries&lt;/P&gt;&lt;P&gt;but I've the following error : Can't read symbolics for targer crc.lib&lt;/P&gt;&lt;P&gt;I don't understand what could be wrong ?&lt;/P&gt;&lt;P&gt;In the .lib file, all the complete&amp;nbsp;paths are indicated, is it possible to have only the short names ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;excuse me&amp;nbsp;for my poor english level&lt;/P&gt;&lt;P&gt;with&amp;nbsp;best regards&lt;/P&gt;&lt;P&gt;francois&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Sep 2010 21:06:42 GMT</pubDate>
    <dc:creator>Francois</dc:creator>
    <dc:date>2010-09-15T21:06:42Z</dc:date>
    <item>
      <title>Info on Timer and on library creation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147642#M7495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We currently use DZ60.&lt;/P&gt;&lt;P&gt;In several applications, we are interested to replace a NE555 in monostable&amp;nbsp;mode by&lt;/P&gt;&lt;P&gt;a TPM timer of the DZ60. (On our application,&amp;nbsp;when the 555 is triggered,&amp;nbsp;its output generates a&lt;/P&gt;&lt;P&gt;pulse of a pre-defined time, polarity of trigger and output is not important).&lt;/P&gt;&lt;P&gt;I've looked at the TPM but I don't see how&amp;nbsp;to create that with&amp;nbsp;a TMP timer ?&lt;/P&gt;&lt;P&gt;If any one has created that function, I'm interested.&lt;/P&gt;&lt;P&gt;With a 18 MHz MCGCLK, accuracy would be 55 ns and max pulse with could be 3.6 ms&lt;/P&gt;&lt;P&gt;with is ok for us. (With the Renesas R8C we also use, it is possible but the timer is only 8 bits wide)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a project which is a library, it compiles fine and creates a .lib file and a .lst file with the entries&lt;/P&gt;&lt;P&gt;but I've the following error : Can't read symbolics for targer crc.lib&lt;/P&gt;&lt;P&gt;I don't understand what could be wrong ?&lt;/P&gt;&lt;P&gt;In the .lib file, all the complete&amp;nbsp;paths are indicated, is it possible to have only the short names ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;excuse me&amp;nbsp;for my poor english level&lt;/P&gt;&lt;P&gt;with&amp;nbsp;best regards&lt;/P&gt;&lt;P&gt;francois&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Sep 2010 21:06:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147642#M7495</guid>
      <dc:creator>Francois</dc:creator>
      <dc:date>2010-09-15T21:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Info on Timer and on library creation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147643#M7496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Francois,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the timer issue, it should be possible to create an accurate monostable pulse using output compare mode for a TPM channel.&amp;nbsp; The TPM module should remain free-running.&amp;nbsp; Two pieces of code would be required - a function to initiate the pulse, and ISR code for the TPM channel.&amp;nbsp; By using the TPM channel pin, the pulse width generated will not be affected by interrupt latency, except that there would be a minimum allowable pulse width setting determined by the worst case latency, including the potential effect of other non-related interrupts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps something like the following untested code could be made to work - I assume the use of TPM2 channel 0 for the purpose of the example.&amp;nbsp; The small delay mentioned needs to be sufficiently large for the function to exit prior to the first compare event occurring.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;volatile word Pwidth;  // Global variablevoid pulse_start( word width){   Pwidth = width;
   __asm sei;               // Disable interrupts   TPM2C0V = TPM2CNT + 50;  // Add small delay to current count   TPM2C0SC = 0x5C;         // Pin is set on compare,                            // interrupt is enabled   __asm cli;               // Re-enable interrupts
}interrupt void TPM2C0_ISR( void){   TPM2C0SC_CH0F = 0;   // Clear flag   TPM2C0V += Pwidth;   // Add pulse width value   TPM2C0SC = 0x18;     // Pin is cleared on compare,                        // interrupt is disabled}
&lt;/PRE&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:49:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147643#M7496</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2020-10-29T08:49:13Z</dc:date>
    </item>
    <item>
      <title>Re: Info on Timer and on library creation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147644#M7497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mac,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your response.&lt;/P&gt;&lt;P&gt;Perharps it could be possible with another microcontroller in the HCS08 serie ?&lt;/P&gt;&lt;P&gt;I supposed it was possible by software but I would have&amp;nbsp;prefer an automatic solution (hardware module of the microcontroller) (as a fault in only&amp;nbsp;one pulse could make short circuit and&amp;nbsp;destroy&amp;nbsp;our device)&lt;/P&gt;&lt;P&gt;But I'll try and I'm confident&amp;nbsp;with the software solution.&lt;/P&gt;&lt;P&gt;Have you an idea about the problem of library creation ?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;francois&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Sep 2010 18:22:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147644#M7497</guid>
      <dc:creator>Francois</dc:creator>
      <dc:date>2010-09-16T18:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: Info on Timer and on library creation</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147645#M7498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Francois,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a variation on the previously proposed method that does not require interrupt usage.&amp;nbsp; Once the pulse is started, the pulse duration is determined entirely by the TPM peripheral hardware, with no further intervention by firmware.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void pulse_start( word width){   __asm sei;               // Disable interrupts   TPM2C0V = TPM2CNT + 20;  // Add small delay to current count   TPM2C0SC_CH0F = 0;       // Clear flag    TPM2C0SC = 0x1C;         // Pin is set on compare   while (!TPM2C0SC_CH0F);  // Ensure flag becomes set   TPM2C0V += width   TPM2C0SC = 0x18;         // Pin is cleared on compare   __asm cli;               // Re-enable interrupts}}
&lt;/PRE&gt;&lt;P&gt;The "small delay" requires to be such that the first output&amp;nbsp;compare event&amp;nbsp;to set the output cannot occur prior to entry to the flag test loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Under what circumstances does a catastrophic failure occur - a missing pulse, pulse too short, or pulse too long?&amp;nbsp; Is there a way to provide current limiting, of over-current protection?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I cannot help you with the library issue.&amp;nbsp; There might be a better response if you were to post this topic alone to the Codewarrior forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:49:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Info-on-Timer-and-on-library-creation/m-p/147645#M7498</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2020-10-29T08:49:15Z</dc:date>
    </item>
  </channel>
</rss>

