This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Have a trouble in Delay programming...

Hello frnz,
i've designed a delay code that is as follows...
for(i=0;i<40000;i++);
The code has been designed for a NXP 89V51RD2 microcontroller similar to 8051 with a clock 11.0592MHz. How much delay could this line possibly generate?.. Time for single instruction is 1.085us. For 40000 counts, it may give upto 40 to 50 milliseconds. But in the development board the same code gives me nearly 0.7 to 1 second delay. Help me out please....

Parents
  • "i've designed (sic) a delay code ... How much delay could this line possibly generate?"

    Surely, if you had really designed it, you would know how much delay it generated - by design...?!

    "Time for single instruction is 1.085us"

    And what, do you think, constitutes such a "single instruction"?

    How many a "single instruction" do you think there are in your 'for' loop?

Reply
  • "i've designed (sic) a delay code ... How much delay could this line possibly generate?"

    Surely, if you had really designed it, you would know how much delay it generated - by design...?!

    "Time for single instruction is 1.085us"

    And what, do you think, constitutes such a "single instruction"?

    How many a "single instruction" do you think there are in your 'for' loop?

Children
No data