Timer Interrupts on Due

I recognize that code fragment 8)

As for digitalWrite not being in the handler, actually it was there originally, but you have to understand that I'd been struggling for hours with interrupt code that wouldn't fire, then it only fired once, then it got hammered with constant interrupts, and I didn't know what was going on. So I did what is pretty much standard debugging practice and changed the interrupt handler to do the absolute bare minimum just to be sure that digitalWrite wasn't causing a side effect (there's some architectures where you can't write certain registers in an interrupt). But the important thing turned out to be the dummy read of TC_SR0. By then it was late so I just posted what I'd done.

Since then I have tried putting digitalWrite and direct port writes back in and they don't seem to cause any odd side effects.

The Maple hardware is completely different unfortunately and the registers are incompatible.