<?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中的主题 Re: PE generated Timer interrupt is running slow</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149345#M7867</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some more information I have found as I worked on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It turns out that the timer is not running slow, but it seems to have a delay before it's first interrupt.&amp;nbsp; When I stop re-initializeing the timer every time, then the time is correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does initializing the timer cause a delay in when the interrupt occurs?&amp;nbsp;&amp;nbsp;&amp;nbsp; I need to create a varialble delay time - what is the appropriate way to get 15uS, 67uS, 240uS or 480uS delays?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Geoff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 20:21:42 GMT</pubDate>
    <dc:creator>Geoff_L</dc:creator>
    <dc:date>2010-09-23T20:21:42Z</dc:date>
    <item>
      <title>PE generated Timer interrupt is running slow</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149344#M7866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used PE to create a period timer on an MC9S08AC48, for some reason the timing of the pulses is off by a factor of 2-3&amp;nbsp;&amp;nbsp; please see the attachment for a screen shot of how I configured the timer.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to use the timer TPM3 to help control communications&amp;nbsp; with a one-wire device.&amp;nbsp;&amp;nbsp; There are four specific timed pulses&amp;nbsp;that I need to bit bang - a 15uS pulse, a 67uS pulse, a 240uS pulse and a 480uS pulse.&amp;nbsp;&amp;nbsp;&amp;nbsp; I configured the bean to provide these options.&amp;nbsp; I have also attached an image of the setting for the four times, and the output of my bit-banging.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way I've approached the bit banging is to write a zero to the one wire bus, then set the timer to interrupt after a certain amount of time and which then writes a one to end it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you look at the attached bit bang, you can see that when I create a low going pulse, and then enable and set the timer for 67uS, as in the code below, the pulse I get is 160uS, not 67uS.&amp;nbsp;&amp;nbsp; Can anyone offer some advice on how to remedy this problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void OW_WriteBit(bool sendbit){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OW_TXBIT(0);&amp;nbsp; //every write is preceded with a 1-0-1 transition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(sendbit) OW_TXBIT(1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)ONEWIRE_TMR_SetPeriodMode(ONEWIRE_TMR_PM_67_0us);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)ONEWIRE_TMR_Enable();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;void OW_TIMER_Int(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void) ONEWIRE_TMR_Disable();&amp;nbsp; //shut down the counter so it doesn't keep going and cause another interrupt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OW_TXBIT(1);&amp;nbsp; //release the bus - let the device respond&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Sep 2010 07:35:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149344#M7866</guid>
      <dc:creator>Geoff_L</dc:creator>
      <dc:date>2010-09-22T07:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: PE generated Timer interrupt is running slow</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149345#M7867</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some more information I have found as I worked on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It turns out that the timer is not running slow, but it seems to have a delay before it's first interrupt.&amp;nbsp; When I stop re-initializeing the timer every time, then the time is correct.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does initializing the timer cause a delay in when the interrupt occurs?&amp;nbsp;&amp;nbsp;&amp;nbsp; I need to create a varialble delay time - what is the appropriate way to get 15uS, 67uS, 240uS or 480uS delays?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Geoff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 20:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149345#M7867</guid>
      <dc:creator>Geoff_L</dc:creator>
      <dc:date>2010-09-23T20:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: PE generated Timer interrupt is running slow</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149346#M7868</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In generall, I think that the problem with difference between the first period &amp;nbsp;and regular periods is caused by handling ISR.&lt;/P&gt;&lt;P&gt;Since you have not provided information about CPU component settings I guess you are using low value of „Internal bus clock“ frequency in comparasion with period that you need to achieve and that leads to problem as is described above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ISR handling can be minimized by increasing internal bus clock frequency (e.g. 20 MHz). In this case I &amp;nbsp;measured difference 600ns between first and regular periods in case of 15us period.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For more details please find enclosed example project.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;best regards&lt;BR /&gt;Vojtech Filip&lt;BR /&gt;Processor Expert Support Team&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 22:54:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/PE-generated-Timer-interrupt-is-running-slow/m-p/149346#M7868</guid>
      <dc:creator>ProcessorExpert</dc:creator>
      <dc:date>2010-10-05T22:54:05Z</dc:date>
    </item>
  </channel>
</rss>

