Description
Interrupts can for example be used to resume tasks that are waiting for a particular event to happen before they can run. Since interrupts can not be nested, the preferred way to handle external events is to start a high priority task by an interrupt and let the task take further action. Well, in fact interrupts could be nested, but this would take an excessive amount of ram, so we do not want to make use of it.
The interrupt on pin PB0 drives a 4 bit counter. The value of the counter determines which leds are allowed to flash. If led PA4 is on, the blinker on PA0 is allowed to run, otherwise it is resumed. The way this works in detail depends on and varies with the setting of the configuration parameters.
Hardware
ATtiny861 and STK500. The eight leds on the STK500 connected to port A. On port B pin 0 must be connected to a switch.
Contact: info@femtoos.org | CC-BY License: Ruud Vlaming. |