Highest PWM frequency output for the Uno/Nano

When I attempt to pause or delay the output, or hold the ledPin HIGH for a longer period, for example with a WHILE or delay() statement, the Serial.print output stops and does not restart unless I reset the board.

Is the posted code the one that works, or does not work?

  Timer0::setMode (2, Timer0::PRESCALE_1, Timer0::TOGGLE_A_ON_COMPARE);

Timer 0 is used for delay(). I suggest using a different timer.