THX FOR YOUR REPLY

robert, i m sending 7 bytes with a baud rate of 2400 . this means 240 byte per second will be recived, that is 0.24 byte per millisecond.

since i m doing a PWM signal, the off time is 18 millisecond ( this is what i can use since it is out of ISR ).

if i disabled the interrupt, and let serin take its time, it may take 7*(1/0.24) = 29 ms. this time i cant afford, since the PWM signal must be 50 Hz ( 20ms) and there is only 18ms free in this period.

got what i mean?

i ll try to recive only two bytes with ur suggestion, should i disable interrupts by writing 'disable' before serin command? and write 'enable' after it?

i ll try what you suggeted