I'll try to be briefer . . .Your lengthy post doesn't answer my query in the previous post however.
That's why I told you how it can be done on a microcontroller, without necesarily having library functions, and without using up processing time just waiting. I assume that you didn't want me to actually write your code for counting to 50, 60, 60 and 24 !I mentioned I was using a microcontroller.
Hi JayOkay, let me use a timer. I am using a 6 Mhz crystal so what would be the C program for the delay in ms milliseconds. I am defining the delay function with an unsigned int ms like this:
void delay(unsigned int ms)
{
..
..
..
}
If I am using a timer what would be the body of the delay function? Btw, I think I will be using a kell compiler, but not sure. I think your idea of using a timer would be better.
Regards,
Jay
It is a simple calculation for you to figure out based on the instruction clock frequency.
void MSDelay(unsigned int itime){
unsigned int i, j;
for(i=0;i<itime;i++)
for(j=0;j<135;j++);
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?