We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello, I would like to know how can i use delays in my program as there is no inbuilt delay for 89c2051. i want to know how can i decide delay timing when I am using 12 MHZ external crystal
Hello Auther actually i am using C for programming .I am giving here smple code function for delay will it work?
void delay(unsigned int d_time) { unsigned int i,k=0; while(k<d_time) { for (i=0 ; i<=1000; i++); k++; } }
That depends on what you mean by "work"...?
In terms of giving a predictable delay, NO - it will not work!
The reason - and the solution - is given here: www.8052.com/.../162556
If you do continue to do this in 'C', you should declare the loop counter as volatile