Thanks to both of you ![]()
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
? 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.