Probably a useful read for anyone trying to accurately generate frequencies in the kHz range using an arduino.
I need to accurately produce 38kHz signals for IR communication projects.
Not all pins give the same frequency output for the same code.
Results in brief: avoid PWM pins if you are not actually using the PWM feature.
In my code instructions took about 4microseconds per half wave form cycle.
Full results after break: