double tElapsed=0; //Refer to document http://www.atmel.com/dyn/resources/prod_documents/doc7530.pdf TCCR1A=0; //set WGM mode to normal. Refer to table 15-4 of above doc TCCR1B=B100; //set prescaler = 256. Refer to table 15-5 of above doc int prescaler=256; TCNT1=0; //set timer to 0. This is a 16 bit timer. Timer overflows at 1.048 seconds with prescaler=256//...time an event or some code tElapsed = TCNT1*1.0/16E6*prescaler; //time in seconds
I'd still be interested in why timer0_overflow_count doesn't seem to exist anymore.