<?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>regarding delay in microcontroller</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/18965/regarding-delay-in-microcontroller</link><description> sir, 
for delay in micro controller, everytime we have to use TMOD and TR and enable corresponding interrupt.is there any other less tedious way of programing a delay using keil cross compiler. 
regards, 
malay lakhani 
final year BE student, 
mumbai</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: regarding delay in microcontroller</title><link>https://community.arm.com/thread/87675?ContentTypeID=1</link><pubDate>Mon, 10 Apr 2006 01:55:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e28ab27f-5cc6-4961-b767-fd821974fe70</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;You could just leave the hardware timer running permanently.&lt;br /&gt;
&lt;br /&gt;
Have a &lt;b&gt;start_timer()&lt;/b&gt; function that sets some global to some suitable value;&lt;br /&gt;
&lt;br /&gt;
Each timer interrupt then decrements the global;&lt;br /&gt;
&lt;br /&gt;
When the global reaches zero, your time is up!&lt;br /&gt;
&lt;br /&gt;
You can easily extend this to support several simultaneous timers...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: regarding delay in microcontroller</title><link>https://community.arm.com/thread/45871?ContentTypeID=1</link><pubDate>Sun, 09 Apr 2006 20:08:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:305d36ab-a5d5-4909-a9b8-db9c07a14bec</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;You could alway use a for loop.  But you have to time it by hand, And, it can change time if you change the compiler or optimization.&lt;br /&gt;
&lt;br /&gt;
make a function called delay that sets the timer and waits for it to be done.  Then use it over and over.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: regarding delay in microcontroller</title><link>https://community.arm.com/thread/87677?ContentTypeID=1</link><pubDate>Sun, 09 Apr 2006 11:02:41 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3b2ad0b3-d6e5-48dd-8f90-99eb6603813e</guid><dc:creator>Karl Hamsher</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;...  maybe you need to find another field of work.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Or put all of that &amp;quot;tedious&amp;quot; stuff in a function or multi-statement macro.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: regarding delay in microcontroller</title><link>https://community.arm.com/thread/45869?ContentTypeID=1</link><pubDate>Sun, 09 Apr 2006 07:43:11 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:23c619fc-7228-4f77-9c4f-aab78227b184</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;&lt;i&gt;for delay in micro controller, everytime we have to use TMOD and TR and enable corresponding interrupt&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;We&amp;quot; don&amp;#39;t need interrupts for that.  It&amp;#39;s perfectly feasible to use polling to find out when the timer has finished running.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;is there any other less tedious way of programing a delay using keil cross compiler.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
To be frank, if you find setting two registers &amp;quot;tedious&amp;quot;, then maybe you need to find another field of work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>