OK, then that gives another figure again ...
We will manually handle external interrupts:
ISR (INT0_vect)
{
PORTB = _BV (5); // toggle pin 13
PORTB = 0;
}
void setup ()
{
pinMode (9, OUTPUT);
pinMode (13, OUTPUT);
// set up Timer 1
TCCR1A = _BV (COM1A0); // toggle OC1A on Compare Match
TCCR1B = _BV(WGM12) | _BV(CS10) | _BV (CS12); // CTC, scale to clock / 1024
OCR1A = 4999; // compare A register value (5000 * clock speed / 1024)
// turn on external interrupt 0 (D2)
EICRA |= _BV (ISC00) | _BV (ISC01); // interrupt on leading edge
EIMSK |= _BV (INT0);
} // end of setup
void loop ()
{
}
This time it is 1.5 uS to handle it.
