For the first example we will use it in normal mode where it ticks from zero to the highest value(255) The Frequency of the Clock Source with CS02, CS01, CS00 bits.With this you can basically select two things: The configuration of the Timer can be set using the TCCR0 register shown below. Another interesting feature is that a value can be set in the Output Compare Register (OCR0), and whenever TCNT0 reaches that value, the Output Compare Flag (OCF0) flag is Set. You can as well load a count value in TCNT0 and start the timer from a specific count. If it does so, a Timer OverFlow Flag(TOV) is set.
If the timer is turned on it ticks from 0 to 255 and overflows.
The TCNT0 register hold the timer Count and it is incremented on every timer "tick". The operation of timer 0 is straight forward. It basically means it can count from 0 to 2^8 255. Let us start our exploration with timer 0.
Timers/counters are an independent unit inside a micro-controller. Remember it is the same hardware unit inside the MCU that is used either as Timers or Counter. Timers/Counters are essential part of any modern MCU.