I have been reading about interrupts for the Arduino for a while now and have been successful with basic hardware interrupts. I have been hearing a lot of people suggesting the use of a Pin Change interrupt which according to the Atmega168 doc, all pins are covered by this feature. Also, I understand that the 3 hardware timers? control this feature in groups, not pin by pin.
I need help setting up the Pin change interrupt and a little clarification as to how the process works... I want to be able to plug an RC servo signal into any pin on the Arduino, and have that pin CHANGE trigger the ISR to store the millis() value on that timer when the pin goes HIGH and again when the pin changes back to LOW, and then subtract the 2 values to get the pulse length.
I know how to setup a Hardware interrupt, but the Pin change interrupts that I have researched all use direct instructions to set the interrupts in the sketch, I am only familiar with the Arduino IDE language, so this is kind of intimidating.
here is my current code to read RC servo signals from 2 pins.
ftp://ftp.rediculouslygoodlooking.com/arduino/LawnBot400/8-24-09/rc_pwm_2ch_8_24_09_pde.pde