<?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>i want timer program to generate pulse using 10khz frequency</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/29517/i-want-timer-program-to-generate-pulse-using-10khz-frequency</link><description> 
here is my code..is it correct.if wrong plz help me to generate
pulse of 10khz . 

 
#include &amp;lt;LPC21xx.H&amp;gt; 

 
void T0isr(void)__irq; 

 
void delay(void) 
{ VPBDIV = 0x00000002; //Set pclk to 30 Mhz 
PINSEL0 = 0x00000020; //Enable pin 0.2 as capture</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: i want timer program to generate pulse using 10khz frequency</title><link>https://community.arm.com/thread/92129?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2012 07:04:18 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:af98cec6-2fad-4a73-8272-fdc8da4d58d7</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;pre&gt;
T0PR = 0x0000001E; //Load prescaler for 1 Msec tick
&lt;/pre&gt;

&lt;p&gt;
Why did you hardcode the value?&lt;br /&gt;
0x1E = 30, and you had 30MHz input frequency. Didn&amp;#39;t you think
30MHz/1MHz would be more readable?&lt;/p&gt;

&lt;p&gt;
And next thing - did you read the text in the datasheet about the
T0PR register? Did you then follow up by looking at the example
timing diagrams? You sure you should divide by 30?&lt;/p&gt;

&lt;p&gt;
Next thing - when you have prescaled down 30MHz to 1MHz you still
wanted 10kHz pulse. How? And how do you think two calls to delay()
helps you? You seen any code somewhere that makes the processor
actually stop and wait into delay() until the required time have
passed?&lt;/p&gt;

&lt;p&gt;
Finally - do consider following the posting instructions for
source code. There are probably lots of errors in the code that no
one will spot because no one will care to read garbled code.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: i want timer program to generate pulse using 10khz frequency</title><link>https://community.arm.com/thread/61223?ContentTypeID=1</link><pubDate>Mon, 08 Oct 2012 05:59:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e43c9928-0fe0-4f8e-b00c-2457d9e77113</guid><dc:creator>H Mackie</dc:creator><description>&lt;p&gt;&lt;p&gt;
What a beautiful example of perfect code.&lt;/p&gt;

&lt;p&gt;
I especially like the use of reentrancy with the delay function. A
lovely touch.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>