eriknyquist:
If you want more I/O, get the Mega- if you want speed, get the chipKit!
You aren't really comparing apples with apples here.
Any code that has delays in it will be slow, by design. analogRead is known to take 104 uS per read. Doing digitalWrite is known to be slower than port manipulation, however there is a digitalWriteFast library that speeds that up for ports that are known at compile time (not variables).
The entire approach of doing software PWM, when hardware PWM is available, is hardly using the chip to its best advantage.
I see from a quick browse that the ChipKit runs at 80 MHz. So you should really be comparing the Due to it, not the Uno.
eriknyquist:
FYI, I tried it with the chipKitUNO32 and it's way faster- 15us to return to the beginning of loop, compared to Arduino at 130us.
It's still not a fair comparison. If the chipKit ran at 16 MHz it would take longer too:
15 * 80 / 16 = 75
That's faster than 130 uS, but the ADC converter may well run faster as well.
