If speed is very critical, I imagine moving the part that does the interrupt handling and turning on specific lights at specific times off to an outboard processor that does not do interrupts, instead it is dedicated, and just reads the status constantly in the loop. It should do nothing but just a busy poll, and turn on/off lights. It would need some way of getting control updates from the brain processor (another pin perhaps). Otherwise you are going to be spending a lot of time having the interrupt set up the call stack and then undo it. And if that is not fast enough, consider getting a faster processor like an ARM embedded board.Perhaps you could use a standard 555 type circuit to do the timing, perhaps not.
Given that the powerDelay array is only assigned values inside one of the ISRs and only read from the other ISR and the ISRs are not nested: Can I remove the volatile attribute from the declaration?
That should give me a few extra cycles in speed shouldn't it?
I'm trying to get 256 levels of brightness, but frankly I'm not sure that level is needed.
QuoteI'm trying to get 256 levels of brightness, but frankly I'm not sure that level is needed.Very unlikely. In my opinion, what works best are fewer levels with levels that reflect how a human perceives brightness. I typically use 100 levels with each level such that a person would say there is about a 1% difference in brightness between each level.