Square or Sinewave

If you can manage with an upper bound of 1MHz then you can use the FrequencyTimer2 library to simplify access to the timer.

Usage:
#include <FrequencyTimer2.h>

FrequencyTimer2::setPeriod(period); // period in microseconds
FrequencyTimer2::enable(); // start pulsing on pin 11 (set this to output mode in setup)

You can find the library here: Arduino Playground - FrequencyTimer2