
40
ATtiny40 [DATASHEET]
8263B–AVR–01/2013
Bit 0 – INT0: External Interrupt Request 0 Enable
When the INT0 bit is set (one) and the I-bit in the Status Register (SREG) is set (one), the external pin interrupt is
enabled. The Interrupt Sense Control bits (ISC01 and ISC00) in the MCU Control Register (MCUCR) define
whether the external interrupt is activated on rising and/or falling edge of the INT0 pin or level sensed. Activity on
the pin will cause an interrupt request even if INT0 is configured as an output. The corresponding interrupt of Exter-
nal Interrupt Request 0 is executed from the INT0 Interrupt Vector.
9.3.3
GIFR – General Interrupt Flag Register
Bit 7 – Res: Reserved Bit
This bit is reserved and will always read as zero.
Bit 6 – PCIF2: Pin Change Interrupt Flag 2
When a logic change on any PCINT[17:12] pin triggers an interrupt request, PCIF2 becomes set (one). If the I-bit in
SREG and the PCIE2 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag
is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it.
Bit 5 – PCIF1: Pin Change Interrupt Flag 1
When a logic change on any PCINT[11:8] pin triggers an interrupt request, PCIF1 becomes set (one). If the I-bit in
SREG and the PCIE1 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag
is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it.
Bit 4 – PCIF0: Pin Change Interrupt Flag 0
When a logic change on any PCINT[7:0] pin triggers an interrupt request, PCIF becomes set (one). If the I-bit in
SREG and the PCIE0 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag
is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it.
Bits 3:1 – Res: Reserved Bits
These bits are reserved and will always read as zero.
Bit 0 – INTF0: External Interrupt Flag 0
When an edge or logic change on the INT0 pin triggers an interrupt request, INTF0 becomes set (one). If the I-bit in
SREG and the INT0 bit in GIMSK are set (one), the MCU will jump to the corresponding Interrupt Vector. The flag
is cleared when the interrupt routine is executed. Alternatively, the flag can be cleared by writing a logical one to it.
This flag is always cleared when INT0 is configured as a level interrupt.
9.3.4
PCMSK2 – Pin Change Mask Register 2
Bits 7:6 – Res: Reserved Bits
These bits are reserved and will always read as zero.
Bit
7
65
43
2
1
0
–
PCIF2
PCIF1
PCIF0
–
INTF0
GIFR
Read/Write
R
R/W
R
R/W
Initial Value
0
Bit
76543210
–
PCINT17
PCINT16
PCINT15
PCINT14
PCINT13
PCINT12
PCMSK2
Read/Write
R
R/W
Initial Value
00000000