This is like asking how many stones will fit in a 4 liter bucket. The first question is, "How big are the stones?"
This sounds suspiciously like a homework problem to me....
In any case, even if I didn't know what processor you were asking about, I'd ask the same two questions, to start:
- What is the clock rate of your processor?
- How many clock cycles does a NOP take to load and execute, including any wait states?
Aside from issues about some prefetching, caching, or speculative execution that some processors use, the answer to your question will fall out of the math.
Close the proper questions for the 8051 are What is the Xtal frequency and what is the clock divider 12, 4, 3,2, or 1 (12 being standard) No prefetching, caching, or speculative execution in this 8 bitter
Each NOP on your processor takes 12 cycles. At 11.03MHz each NOP is 12/11030000 or about 1088nS. So for 1mS you need 1000000/1088 NOPs which is 919.
However only the Ravenous Bugblatter Beast of Traal would be stupid enough to use that method of doing a delay because it wastes enough program space to build a hypersteller bypass in it. The correct way to do a delay is to use the timer. If the timer is being used for something else then Don't Panic it's not the End Of the World. Instead construct a delay loop and that will use much less space.
Your next task is to read the datasheets and understand how the crystal frequency is related to the machine cycle, and how many cycles each of the instructions take. It's not rocket science.
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.