As mentioned before, once an interrupt is enabled it will be triggered even when the corresponding pin is configured as output.
Task: Enable 16-bit Timer 1 in CTC mode with OC1A pin (PB1 pin - configured as output) (also PCINT1 pin) toggling on compare match. Enable the interrupt PCINT1 with the ISR containing a routine that turns on and off the LED0 connected to PORTC. Pin Change Interrupt PCI0 triggers if a pin in PCINT[7:0] is toggled while enabled. Here PCINT1 is enabled.
Without using STK600, connect two LED circuits as shown in Figure 1; one at PC0 and another at PB1.
When running the example code, LED1 (connected to OC1A pin) toggles because of timer action. Whenever LED1 switches OFF (means a transition from low to high – a rising edge) or switches ON (means a transition from high to low – a falling edge), PCINT1 interrupt is triggered and so LED0 blinks once.