Jay_
Member level 3
Hey, how can I give a delay in ms using a for loop while programming in C microcontroller 89V51RD2BN which uses XTAL = 6MHz.
For instance I have the function for delay named ms_delay(argument);I define this as:
void ms_delay(unsigned int ms)
{
for (i=0; i<ms; i++)
for (j=0; j<X;j++)
}
what should be the value of X for a delay of the given milliseconds ms? I don't know how long a for loop takes which is the problem.
Regards,
Jay.
For instance I have the function for delay named ms_delay(argument);I define this as:
void ms_delay(unsigned int ms)
{
for (i=0; i<ms; i++)
for (j=0; j<X;j++)
}
what should be the value of X for a delay of the given milliseconds ms? I don't know how long a for loop takes which is the problem.
Regards,
Jay.