Sorry Alex, still confuse to me his code above. Is your 'COUNT' the count register of TCC0?
Correct.
In my understand you are manipulating the Mux similar I made above.
Your understanding is wrong.
I enable the mux, so that TCC can drive the pin, then I call wait_start() 8 times, this waits until TCC changes the state 8 times, then I disable the mux, so that PORT peripheral drives the pin, which makes it go low, because I previously set output to 0 (PA9_clr()).
The timer is still running and counting, it is just not in control of the pin anymore.
This method gives you accurate timing, since it is derived from the hardware, byt you still have control over number of pulses, you just need to be fast enough to take the output from the timer when it is time, but at 64 kHz it should not be a big problem.