detachInterupt() from the inside of the interupt function?

Thanks to both of you :slight_smile:

Incidentally, i should be declared volatile.

Well it doesnt change if I set the i volatile. But it puts out a part of the data when I put the interuptFlag volatile.
Still, it misses some data. I guess the if(i > bufLen) statement adds to much delay :frowning: ? The enable period is about 1.1ms so that should work...

How about immediately returning from the ISR if it has been called the requisite number of times ?

What do you mean by returning from the ISR immediatly?

The loop() could run fast enough to read every data byte, so perhaps a buffer is not needed. Perhaps a counter could be added to detect a missing byte. If the data is not needed, it is okay to let the interrupt still be active.

Hmm... I'll try that as well.