For a bitbanging project I'm working on, I need to measure microseconds as accurately as possible. The function micros() won't work for me here because of the unpredictable times at which it might roll over. I have been using this project by Louis Frigon as an example:
https://web.archive.org/web/20140627135927/http://www.sigmaobjects.com/toyota/
In this document he sets his Atmega8's prescaler value:
// Timer 0 prescaler = 8 ( 1 count / us )
TCCR0 = _BV(CS01);
Do I understand that after these instructions, TCNT0 counts up by nearly precise microseconds? If so, what math could I use to set my prescaler for measuring microseconds? The 328P has a higher clock speed, does that mean I won't be able to do this?