<?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: Delay function and more</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128898#M1014</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;1. The operating frequency depends of the crystal used in the evaluation board you have, and if the FLL is enabled. Therefore we required more information to help you solve your issue ( which board, which crystal, FLL enabled, which MCU part number, which code are you using, compiler, which tess are your running, etc).&lt;BR /&gt;&lt;BR /&gt;2. See response #1.&lt;BR /&gt;&lt;BR /&gt;3. If you use CodeWarrior and Processor Expert, there is a Bean called TimerInt that will give you precisely that: a Programmable Timed Interrupt.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2006 01:31:10 GMT</pubDate>
    <dc:creator>alex_spotw</dc:creator>
    <dc:date>2006-03-16T01:31:10Z</dc:date>
    <item>
      <title>Delay function and more</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128897#M1013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello ppl,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have HC12 ucontroller on a MC68HC912 board and I need a little help here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1st, i'd like to know what is the CPU speed, as 8MHz nor 16MHz is not what i'm getting from my tests.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2nd, how many cycles is one for (;&lt;/SPAN&gt;&lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;SPAN&gt; loop, or how much time will take one loop on my controller.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3rd and last, does anyone have a code for a delay function that will recieve the time and will create a useconds accuracy (1us, 4us, etc.) delay?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I preffer using the timer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Mar 2006 22:13:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128897#M1013</guid>
      <dc:creator>JamesWorthy</dc:creator>
      <dc:date>2006-03-15T22:13:54Z</dc:date>
    </item>
    <item>
      <title>Re: Delay function and more</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128898#M1014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;1. The operating frequency depends of the crystal used in the evaluation board you have, and if the FLL is enabled. Therefore we required more information to help you solve your issue ( which board, which crystal, FLL enabled, which MCU part number, which code are you using, compiler, which tess are your running, etc).&lt;BR /&gt;&lt;BR /&gt;2. See response #1.&lt;BR /&gt;&lt;BR /&gt;3. If you use CodeWarrior and Processor Expert, there is a Bean called TimerInt that will give you precisely that: a Programmable Timed Interrupt.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 01:31:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128898#M1014</guid>
      <dc:creator>alex_spotw</dc:creator>
      <dc:date>2006-03-16T01:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Delay function and more</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128899#M1015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Alex,&lt;BR /&gt;&lt;BR /&gt;I have found a pdf that helped me with the delay, so I have made this code:&lt;BR /&gt;&lt;BR /&gt;void main(void) {&lt;BR /&gt;&lt;BR /&gt;TSCR1_TEN=1; // Enable timer&lt;BR /&gt;TIOS_IOS0 = 1; // Set bit 0 as output compare&lt;BR /&gt;&lt;BR /&gt;us_delay(8);&lt;BR /&gt;&lt;BR /&gt;for( ; ; ) {} /* wait forever */&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;void us_delay(int useconds)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;TSCR2_PR = 0; // Prescale = 1&lt;BR /&gt;TC0 = (useconds * 16) + TCNT; // 16MHz * useconds = # of ticks&lt;BR /&gt;TFLG1 = TFLG1_C0F_MASK; // Reset flag&lt;BR /&gt;while (TFLG1_C0F==0); // Wait for time out&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;But, how many ticks does it take to call and return to/from a function?&lt;BR /&gt;As I said before I have MC68HC912 board, and if I'm not wrong, the crystal frequency is 32MHz.&lt;BR /&gt;And what is FLL?&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;P&gt;Message Edited by JamesWorthy on &lt;SPAN class="date_text"&gt;03-15-2006&lt;/SPAN&gt;&lt;SPAN class="time_text"&gt;03:22 PM&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 05:20:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128899#M1015</guid>
      <dc:creator>JamesWorthy</dc:creator>
      <dc:date>2006-03-16T05:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Delay function and more</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128900#M1016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;FONT size="2"&gt;Hello James,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;To find out the actual delay associated with a simple non-interrupt &lt;FONT face="Courier New"&gt;for()&lt;/FONT&gt; loop, it is probably easiest to measure it&amp;nbsp;using the debugger/simulator, with the accumulated cycle count.&amp;nbsp; Just break both before entry to, and after exit from&amp;nbsp;the delay function, and note the cycles difference.&amp;nbsp; Of course, you will still need to ascertain the bus frequency to relate this to a time value.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;FLL = frequency lock loop, part of the clock generator module for some MCUs.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;Regards,&lt;BR /&gt;Mac&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2006 21:23:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Delay-function-and-more/m-p/128900#M1016</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2006-03-16T21:23:07Z</dc:date>
    </item>
  </channel>
</rss>

