implemented a TMR0 function;