
Originally Posted by
tumbleweed
You might be looking at this the wrong way around and have the stuff you're doing in the interrupt and the main loop backwards.
I usually reserve using interrupts for events that must be done at a high priority, and leave the not so important things that aren't as time sensitive and can wait a bit for handling in the main loop.
For example, the matrix scanning would be done by a timer ISR running fast enough to do the scanning w/out producing any flickering (like Richard's charlieplexing routine)
All the other stuff would be done by polling in the main loop ie looking for key press, reading knobs, etc. That way no matter what your main loop is doing the matrix scanning always gets done when it needs to.
Bookmarks