Faster Routine

PD7 is TIOA8 (arduino pin 11).

Set Timer Counter 2 channel 2 (TC8) with the correct frequency and TIOA8 will toggle up to 21 MHz.