analogWrite - only 0 to 255

An example on this page:

Example code:

#include <TimerHelpers.h>

...

  // Timer 1 - vertical sync pulses
  pinMode (vSyncPin, OUTPUT); 
  Timer1::setMode (15, Timer1::PRESCALE_1024, Timer1::CLEAR_B_ON_COMPARE);
  OCR1A = 259;  // 16666 / 64 uS = 260 (less one)
  OCR1B = 0;    // 64 / 64 uS = 1 (less one)

In this particular case the frequency was 60 Hz and the duty cycle 1 / 260. However by making OCR1A larger you could get a smaller duty cycle and thus a higher resolution (but a lower frequency). You can change the frequency to an extent by altering the prescaler.