<?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>LPC Microcontrollers中的主题 Re: delay function</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584448#M21036</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rocketdawg on Wed Jan 27 12:12:10 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;you are going to spin-in-place a 204Mhz processor?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why not use a state machine and have a timer ISR call a CallBack function to change the state of the state machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:13:05 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:13:05Z</dc:date>
    <item>
      <title>delay function</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584446#M21034</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by mc1992 on Wed Jan 27 09:35:44 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello friends!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a&lt;/SPAN&gt;&lt;STRONG&gt; lpc4337&lt;/STRONG&gt;&lt;SPAN&gt; , it has a clock of &lt;/SPAN&gt;&lt;STRONG&gt;204Mhz&lt;/STRONG&gt;&lt;SPAN&gt; and i'm programming in C language . How I can make a delay function in &lt;/SPAN&gt;&lt;STRONG&gt;ms&lt;/STRONG&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;STRONG&gt;us&lt;/STRONG&gt;&lt;SPAN&gt; for this micro?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:13:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584446#M21034</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: delay function</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584447#M21035</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by vtw.433e on Wed Jan 27 10:31:13 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Search the forum - there are plenty of examples. Hint - use a timer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:13:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584447#M21035</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: delay function</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584448#M21036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rocketdawg on Wed Jan 27 12:12:10 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;you are going to spin-in-place a 204Mhz processor?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why not use a state machine and have a timer ISR call a CallBack function to change the state of the state machine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:13:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584448#M21036</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: delay function</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584449#M21037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by sgstreet on Thu Jan 28 16:43:23 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;try this for gcc where SystemCoreClock is the CMSIS variable as set by the LPC startup code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;#define CPU_NANOSEC(x) (((uint64_t)(x) * SystemCoreClock) / 1000000000)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;static __attribute__((optimize("0"))) inline void wait_usecs(uint32_t usecs)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; volatile register uint32_t cycles = (usecs * CPU_NANOSEC(1000)) &amp;gt;&amp;gt; 2;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; while (cycles--);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:13:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/delay-function/m-p/584449#M21037</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:13:06Z</dc:date>
    </item>
  </channel>
</rss>

