Dear Friends,
I am using an ARM7 LPC2129 controller with 10~Mhz external oscillator. My controller is running at 60Mhz and PCLK at 30Mhz.
I have a quick question for you. I want to write a delay function this way:
void Delay (unsigned char DelayInMilliSec) { unsigned long Timing,Loop;
for(Loop=0;Loop<DelayInMilliSec;Loop++)
for(Timing=0;Timing<xxxxx;Timign++); //I want one milli Second delay here
}
What value should I keep in place of xxxxx to generate a one milli second delay. I donot want to use the timer functionality. It will be ok using the NOP instruction, but please guide me what should be done to generate the one milli second delay in place of second for loop..
Thank you dudes in advance for the reply.
Oh no, not this old chestnut again!
Do not write a delay function in a High-Level Language (HLL) - see: www.8052.com/.../162556
In fact, for delays on the order of milliseconds, it is probably a bad idea to busy-loop at all!
Put "HLL" into the 'Search' box, and study the results to see why this kind of thing should really not be done in an HLL!
www.keil.com/.../search.asp