delay of 1 us

what is the command line to generate delay of 1 us ?????????? I want to make dc/dc converters :slight_smile:

There isn't one.
http://arduino.cc/en/Reference/DelayMicroseconds
You could try some assembler.
Or use the hardware to generate your 500kHz signal.

What's wrong with your '?' key?
Is it sticky?

That is a very small delay for C code running at these clock rates. You could use assembler to insert NOOP instructions, or you could try trivial math operations like incrementing a byte. Make sure you comment why you are doing such seemingly useless tasks in the code.

Make sure you comment why you are doing such seemingly useless tasks in the code.

Make sure you declare the variables involved volatile, too, so the compiler doesn't say "Hey, doofus, this code doesn't accomplish anything" and delete it.

(This doesn't have anything to do with the OP's question but..)
PaulS, what is the reason why a volatile-defined variable would prevent that?

Normally, you declare something volatile if there is no obvious way for the value to change, but the value could be changed elsewhere, typically in an interrupt service routine.

flag = 0;
while (flag == 0) 
{
  someCounter++;
}

here, "flag" isn't changed within the loop, so the compiler could simply compile the code as though you had written

while (1) {
  someCounter++;
}

marking the variable "flag" as volatile forces the compiler to generate code to reload the variable "flag" and test it every time through the loop.