I normally bypass the Arduino firmware and use the timer/counter hardware and interrupts natively in my projects - so I'd not realized that.
The Arduino platform is a great thing, but it tends to get in the way when you want really accurate timing. You can still use the IDE of course - it's just a matter of a few lines of code to shut down the Arduino platform timers, and then reconfigure them to do exactly what's needed for your project.
I wrote a context switcher for the ATmega2560 yesterday in assembler. I needed it for my Space Invaders project where I'm copying the original 1978 TAITO ROM 8080 code layout. There are two different interrupt tasks both driven at 60Hz when the CRT beam reaches different points on the video screen. When the player loses a life in one of the interrupts, the 8080 code resets its stack pointer, and jumps out of the interrupt routine back to a point in the main, non-interrupt loop. That was impossible for me to code in standard Arduino C++, but with a bit of assembler (which the Arduino platform fully supports) I've now got it working.
