| ??? 08/06/06 05:58 Read: times |
#121717 - help with c51 |
Hello,
This is the first time I'm writing a c code for the keil c51 conpiler so please help me out. Here is a sample delay code I wrote, I guess it is approximately 4 seconds, but the problem is it is not giving a uniform delay. After giving 4seconds delay for 10 times, it gives a delay of 10seconds and then it's back to normal. Also please tell me who to calculate exact delay for c code.
#include <reg51.h>
void delay(void)
{
int i,j;
for(j=0;j<10;j++)
for(i=0;i<32767;i++)
i=i;
}
void main(void)
{while(1)
{
P1=0x00;
delay();
P1=0x0ff;
delay();
}
}
Thank you Ashwin.V |



