A main loop reads a 16-bit counter while an interrupt increments it on an 8-bit AVR. Why can an occasional reading appear to jump backward or forward even when the variable is declared volatile?
What is a small, predictable way to obtain a consistent snapshot?




