AVR tiny13 have one timer and it count until to 0xFF value for each clock. An interrupt will be then generated and call your interrupt routine.
In our example, we have the following interrupt routine:
ISR(TIM0_OVF_vect) {
if (led){
b0_high;
led = 0;
} else {
b0_low;
led = 1;
}
}
This routine is used to toggle the LED On or Off.
The complete project code can be found here: http://labs.bitartist.org/timer_int.tar.gz
No comments:
Post a Comment