Datasheet

52
ATtiny828 [DATASHEET]
8371A–AVR–08/12
The pin change interrupts trigger as follows:
z Pin Change Interrupt 0 (PCI0): triggers if any enabled PCINT[7:0] pin toggles
z Pin Change Interrupt 1 (PCI1): triggers if any enabled PCINT[15:8] pin toggles
z Pin Change Interrupt 2 (PCI2): triggers if any enabled PCINT[23:16] pin toggles
z Pin Change Interrupt 3(PCI3): triggers if any enabled PCINT[27:24] pin toggles
Registers PCMSK0, PCMSK1, PCMSK2, and PCMSK3 control which pins contribute to the pin change interrupts.
Pin change interrupts on PCINT[27:0] are detected asynchronously, which means that these interrupts can be used for
waking the part also from sleep modes other than Idle mode.
In order for a pin change interrupt (PCINT) to be generated, the device must have an active I/O clock. As shown in Table
9 on page 34, the I/O clock domain is active in Idle Mode, but not in deeper sleep modes. In sleep modes deeper than
Idle Mode, a toggled pin must remain in its toggled state until the device has fully woken up. See Table 7 on page 30 for
wake up times. If the pin toggles back to its initial state during wake up the device will still complete the procedure but will
not generate an interrupt once awake.
External interrupts INT0 and INT1 can be triggered by a falling or rising edge, or a low level. When INT0 or INT1 is
enabled and configured as level triggered, the interrupt will trigger as long as the pin is held low.
Note that recognition of falling or rising edge interrupts on INT0 and INT1 requires the presence of an I/O clock, as
described in “Clock System” on page 27.
9.2.1 Low Level Interrupt
A low level interrupt on INT0 or INT1 is detected asynchronously. This means that the interrupt source can be used for
waking the part also from sleep modes other than Idle (the I/O clock is halted in all sleep modes except Idle).
Note that if a level triggered interrupt is used for wake-up from Power-down, the required level must be held long enough
for the MCU to complete the wake-up to trigger the level interrupt. If the level disappears before the end of the Start-up
Time, the MCU will still wake up, but no interrupt will be generated. The start-up time is defined as described in “Clock
System” on page 27.
If the low level on the interrupt pin is removed before the device has woken up then program execution will not be
diverted to the interrupt service routine but continue from the instruction following the SLEEP command.
9.2.2 Pin Change Interrupt Timing
A timing example of a pin change interrupt is shown in Figure 20.