atmega32u4 generate clock using timer4
I found the following solution for the problem:

// reset timer4
OCR4C = 0;
OCR4D = 0;

TCCR4A = 0x00;
TCCR4B = 0x00;
TCCR4C = 0x00;
TCCR4D = 0x00;

TCNT4=0;

// Toggle OC4D on Compare Match | enable PWM
TCCR4C = _BV(COM4D0) | _BV(PWM4D);


// Clear Timer on Compare Match
TCCR4D = _BV(WGM41);

// set lock bit for sync update
TCCR4E = _BV(TLOCK4);

// Set compare value
OCR4C = CLOCKCYCLE*2;
OCR4D = CLOCKCYCLE;

// No prescaling
TCCR4B = _BV(CS10);