It is possible to create less than 1ms on and off

It would like to create a PWM signal with less than 1ms period. Even if I gave it a 0 ms or 0.1 ms delay time, the board automatically pause for 1 ms. I am using the duemilanove.

Thank you in advance!

There is hardware PWM on six output pins, but if you meant to make a square wave in software, the delay(int milliseconds) won't delay for less than one millisecond. (Any fraction like 0.1 is rounded down to fit in an int value.) See the delayMicroseconds(int microseconds) for much shorter delays.

Thank you very much. It works with delayMicroseconds.

Yes, I would like to generate a PWM only for 20ms, then turn on for high later. So the function above works great.

I'm doing this in the 50uS range and precisely controlled intervals between flashes with the FrequencyTimer2 library. For slower delays between flashes (I go up to 1 second), I use a postscaler.