Arduino is "in the mail". I'm studying up and seem to be missing some documentation.
I have the Arduino Reference (it came with the Arduino-011 package) and the Atmel reference (376 pages!) for the ATmega168.
I want to use timers and interrupts yet I see little (only attach & detach; not even enable & disable!) information in the Arduino extended reference.
Where's the "nitty gritty" on implementing interrupts and using timers in Arduino? Is this possible using the Arduino tools? Or does this require something like writing an assembly lib. routine?
Help finding documentation and suggestions as to how interrupts and timers are used would be appreciated...ß
I don't want to implement interrupts generated by the counter. I want to use external interrupts to execute a routine which will read the value of the counter then reset it. I'm comparing the timing of 2 external events. (I need 2 timers, 2 external interrupts.)
So the general answer to my Q is that this capability isn't handled by Arduino's standard implementation; I need to use library functions to handle interrupts and manipulate the counters? This is why no mention is made in the reference?
You can use the External interrupts 0 and 1, available on digital pins 2 and 3 respectively. These are the two interrupts that use the attachInterrupt function. When you call it, it will automatically enable the interrupts for those two vectors.
You can set the interrupts to trigger on the falling or rising edge of the signal, or when it is low. The datasheet describes them as INT0 and INT1, starting from page 67.