Timing and speed issues with pin change interrupt based routines - Arduino slow?

Hi,
Post your code, its possibly an error in the way you are managing variable access.

500*12 is 6000, so 18,000,000 divided by 6000 = 2,666 clock cycles available to process each interrupt. A pin change interrupt takes around 68 clock cycles to process depending on the ISR content.

One potential problem is that if all of your pins change at the same time it will take around 700 clock cycles to get through all the ISRs, thats about a 40 microsecond log jam of interrupts.

To eliminate variable access check out this post, its using pin change ints at a much lower frequency but outlines a variable access/protection strategy.

Duane B

rcarduino.blogspot.com