<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Trying to generate nano seconds delay in LPC1768</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/47605/trying-to-generate-nano-seconds-delay-in-lpc1768</link><description> We are trying to develop the nano seconds delay but ended up with 1 us delay minimum. 
 init_timer() 
 { 
 LPC_SC-&amp;gt;PCONP |= (1&amp;lt;&amp;lt;SBIT_TIMER0) | (1&amp;lt;&amp;lt;SBIT_TIMER1); /* Power ON Timer0,1 */ 
 LPC_TIM0-&amp;gt;MCR = (1&amp;lt;&amp;lt;SBIT_MR0I) | (1&amp;lt;&amp;lt;SBIT_MR0R); /* Clear TC on</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Trying to generate nano seconds delay in LPC1768</title><link>https://community.arm.com/thread/167416?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 08:53:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e17abbc5-543a-4118-b821-b4fc0567cc0d</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;So what clock frequency are you using?&lt;/p&gt;
&lt;p&gt;Note that the operation of the timers &amp;amp; clock system is entirely specific to the chip manufacturer - NXP, in this case - and nothing to do with Keil or ARM:&lt;/p&gt;
&lt;p&gt;&lt;a href="/developer/tools-software/tools/f/keil-forum/43684/lpc2148-timer0-not-working-as-expected/158950#158950"&gt;https://community.arm.com/developer/tools-software/tools/f/keil-forum/43684/lpc2148-timer0-not-working-as-expected/158950#158950&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So you need to be talking to &lt;strong&gt;NXP&lt;/strong&gt; about how to correctly configure their &lt;em&gt;&lt;strong&gt;chip&lt;/strong&gt; &lt;/em&gt;to your purpose.&lt;/p&gt;
&lt;p&gt;Also remember that code takes a finite time to execute, and it takes a finite time from the occurrence of the hardware event before execution reaches the ISR for that event ...&lt;/p&gt;
&lt;p&gt;That bit &lt;em&gt;&lt;strong&gt;is&lt;/strong&gt; &lt;/em&gt;defined by ARM:&lt;/p&gt;
&lt;p&gt;&lt;a href="/developer/ip-products/processors/b/processors-ip-blog/posts/beginner-guide-on-interrupt-latency-and-interrupt-latency-of-the-arm-cortex-m-processors"&gt;https://community.arm.com/developer/ip-products/processors/b/processors-ip-blog/posts/beginner-guide-on-interrupt-latency-and-interrupt-latency-of-the-arm-cortex-m-processors&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www2.keil.com/docs/default-source/default-document-library/01_shore_arm.pdf?sfvrsn=2"&gt;www2.keil.com/.../01_shore_arm.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nxp.com/docs/en/application-note/AN12078.pdf"&gt;https://www.nxp.com/docs/en/application-note/AN12078.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There will also be a finite delay between modifying a bit in a GPIO control register, and the state of the pin actually changing - again, this is chip-specific.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/471/2388._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to generate nano seconds delay in LPC1768</title><link>https://community.arm.com/thread/167410?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 08:09:36 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c0e6ca8c-2a4c-46a4-99de-7b2630885f5f</guid><dc:creator>R.Kopsch</dc:creator><description>&lt;p&gt;Keil CMSIS-RTOS docu confirming &amp;quot;millisec&amp;quot; time delay value:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;a href="https://www.keil.com/pack/doc/cmsis/RTOS/html/group__CMSIS__RTOS__Wait.html#details"&gt;www.keil.com/.../group__CMSIS__RTOS__Wait.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to generate nano seconds delay in LPC1768</title><link>https://community.arm.com/thread/167408?ContentTypeID=1</link><pubDate>Thu, 10 Sep 2020 08:06:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e25e0bcb-2e1c-4054-8709-b00e576381fc</guid><dc:creator>R.Kopsch</dc:creator><description>&lt;p&gt;Similar discussion:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://community.arm.com/developer/tools-software/tools/f/keil-forum/20595/50ns-delay-generation-on-lpc2129"&gt;community.arm.com/.../50ns-delay-generation-on-lpc2129&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>