Remember that 1 instruction cycle equals 4 clock impulses ( clock cycles ). So if you got 20 MHz it makes 5000000 instructions per second. And NOP takes 1 instruction cycle and very low power.
Try to make a progress by dividing numbers and then go for loops.
i want to generate '1' and '0' with the intervals between 10 microseconds..can anyone give me a instruction how to do this..i'm using c programming to build this operation.
The time intervals and the MCU you are using might be a mismatch if you want to program in "C". The 20 MHz PIC is simply a bit slow to execute enough instructions for a "C" delay function within 1 us.
Either you go to ASM or to a much faster processor.
i'm looking for a solution for ATMega128 microcontroller and i want to control the I/O pins with microsecond precision i.e. each pin has to go high and low after a delay of few microseconds. can anybody help me with this ?
Not sure about the compiler you are using, but there may be an include file in the library that allows the use of a nop instruction within C. Otherwise you need to insert some assembler routines.