shaswat
Advanced Member level 4
I have a avery basic doubt in this program just because as a newbie in programing I don't understand the delay in this code. I read the books but didn't get how the delay code is works.
The clocl frequency is set at 11 MHz and delay is 25ms. Its hard to understand me that how he select the 250ms delay. Why 1275???
The clocl frequency is set at 11 MHz and delay is 25ms. Its hard to understand me that how he select the 250ms delay. Why 1275???
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 #include <reg51.h> void MSDelay(unsigned int); void main(void) { while (1) //repeat forever { p1=0x55; MSDelay(250); p1=0xAA; MSDelay(250); } } void MSDelay(unsigned int itime) { unsigned int i,j; for (i=0;i<itime;i++) for (j=0;j<1275;j++); }
Last edited by a moderator: