00001 00002 /*_____ I N C L U D E - F I L E S _________________*/ 00003 #include "timer0_lib.h" 00004 00005 /*------------------------------------------------*/ 00006 /* Timer Start */ 00007 /*------------------------------------------------*/ 00008 void Timer0_start(U8 timout){ 00009 00010 TCCR0A = 0x00; // Counter Mode - Normal 00011 TCCR0B = 0x02; // fosc /64 = 8000000/64 ^= 8us 00012 TCNT0 = timout ; // Set Timer Value for a Tbit overflow 00013 00014 } 00015 00016 /*------------------------------------------------*/ 00017 /* Timer Stop */ 00018 /*------------------------------------------------*/ 00019 void Timer0_stop(void){ 00020 00021 TCCR0A = 0x00; //stop timer clock 00022 TCCR0B = 0x00; //set timer to normal mode 00023 TIFR0 = 0x01; //TOVL0 irq flag loeschen 00024 00025 } 00026 00027