i'm playing around with two touchpads connected to
one arduinoNG.
everything seems to work fine - i can read extended
packets from the pads:
absolute x, absolute y, z (pressure)
i modified the ps/2-mouse-example from the playground
and attached an interrupt instead of the while-loops to
check if the CLOCK-line is FALLING (which means that the
pad is ready to send data).
it doesn't work perfectly because i shouldn't use any
delays anymore. now the first call of the interrupt works
perfect but then the program stucks again inside of
a whileloop, which is essentially for datatransmisson
(i think)
Instead of using a busy loop, maybe you should count timer ticks. Look at the actual code in delayMicroseconds() - you want to do the same thing except not disable interrupts.
Using a for loop like that isn't very reliable. First of all, how the compiler optimizes things will effect how (or sometimes if) the loop is done. So if a new avr-gcc or IDE comes out you might have to recalibrate. Second, how long the loop takes willl vary depending on how many interrupts the arduino services - which you don't have much control over. And finally, although it's rare, not all chips use the same clock speed.
Counting ticks is better. The timer is just a register and the math isn't that hard.