Atmega2560 Usart Interrupt problem
In your code:


You increment the NUMBER_OF_RECEIVED_BYTES only in your ISR.
You have a loop before sei();, waiting for NUMBER_OF_RECEIVED_BYTES not to be 0 .
So your loop will be infinite, because the global interrupts are disabled and your ISR won't be called to increment your variable.


See:

while (NUMBER_OF_RECEIVED_BYTES == 0); // &lt;---- infinite since interrupts are disabled
DDRB |= (1 &lt;&lt; DDB7);
sei();   //&lt;-------- thus, this line is never reached, interrupts won't be enabled


I do not know what is the purpose of this loop: while (NUMBER_OF_RECEIVED_BYTES == 0);, but you should enable interrupts before it starts.