hi i am jimmy and my problem is very simple but complicated. how to make a loop subroutine for 1 sec +500 microsec or -500 microsec by just using djnc, mov and nop. it is a 8051 problem so kindly help me.
"it is a 8051 problem" So why have you chosen C251 as the product?? Presumably this is your homework, so you are supposed to come up with the answer yourself? But here's a hint: you need to know two things: 1). Your processor's clock frequency; 2). How many clock cycles (and, hence, how long) it takes to execute the djnc, mov and nop instructions on the particular variant you are using. Knowing those two things, you should be able to see how you can use them together to make your required delay...