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.
"I wonder if it is really Keil code, or code from NXP."
In the case of the file LPC32_EMAC.C, I think it does come from Keil - Although some parts may have been derived from NXP code.
The NXP code for the LPC3250 definitely falls into the really shitty category!
Yes, there is certainly Keil code that does it - I think most of their "Blinky" examples do!
While it can be OK for quick-&-dirty stuff like "Blinky", I think Keil really should clearly comment comment the pitfalls - otherwise they are just setting a bad example...