Timer or counter?

The CLDIV8 fuse catches a lot of folks when they first start working with the AVR. Note that you can change the divisor via software rather than the fuse. I also wonder if this is the source of your debugwire problem. No idea if this will work, but try the following if nothing else does:

Set the CLDIV8 fuse and see if DebugWire starts working. Then, change your code and add the following to the beginning:

CLKPR=(1<<CLKPCE); // enable divisor change

CLKPR=0; // set divisor to 1

This may or may not work in C. The issue is that the first store to CLKPR enables a 4 cycle internal timer in which the second write actually updates the system clock prescaler. However, I don’t know if the compiler will generate fast enough code. It shound since its just an LDI/OUT combo, but who knows (I always program in assembly so have not run into any timing problems).