No danger - no smoke, just a few lines of crazy code.
Well, the ATmega328-INT0 can be programmed to get activated on both rising AND falling levels.
And any output pin can get toggled by writing a "1" to the corresponding input register. What if you feed the output directly to the ISR input? Very simple: it will oscillate. You can watch the pin-13-LED getting only half-bright. The frequency generated by this software short-circuit will be 242.4 kHz on the UNO equivalent to 66 CPU cycles. If you add NOP instructions before the toggle command you get two cycles more for each NOP.
As INT0 has highest priority other interrupts (loop=Timer0) do not affect this frequency.
Is it useful at all? Most probably not - except for studying some internals. And having fun!
[code]
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
// send output from pin-13 to pin-2 via a short wire
EICRA = 1; // Any logical change on INT0 generates an interrupt request.
EIMSK = 1; // Bit 0 – INT0: External Interrupt Request 0 Enable
}
void loop() {}
ISR (INT0_vect) { // read pin-2:
PINB = B00100000; // toggle PIN-13:
}
[/code]