Timer in CTC mode to generate 1MHz pulse

You failed to mention the processor.