library code for ATmega8