However the counter can only count up to either 256 8 bit counter or 65535 16 bit counter.
Timers and counters in microcontroller.
The at89s8253 has three timers counters marked t0 t1 and t2.
Since the 8051 follows an 8 bit architecture each 16 bit is accessed as two separate registers of low byte and high byte.
A timer uses counter which counts at certain speed depending upon the clock frequency.
That s far from the 1 000 000 ticks per second that the standard avr microcontroller provides.
Higher the clock frequency higher will be the processing speed.
The timer and counter functions in the microcontroller simply count in sync with the microcontroller clock.
The 8052 has these two plus one more.
It counts the cycle of the peripheral clock or an externally supplied clock.
In arduino uno it takes 1 16000000 seconds or 62nano seconds to make a single count.
The 16 bit register of timer 0 is accessed as low and high byte.
The figure below shows the prescaler and input selector configuration for a timer counter control registered as used in most avr microcontrollers.
In the timer mode the register is incremented after every machine cycle.
The 8051 has two counters timers which can be used either as timer to generate a time delay or as counter to count events happening outside the microcontroller.
The timers and counters in 8051 microcontroller has two 16 bit timer counter registers.
Both timers are 16 bits wide.
The timer and counter functions in the microcontroller count in sync with the microcontroller clock.
The 8051 has two timers.
Tmod timer mode register and tcon timer control register which are used for activating and configuring timers and counters.
Counters and timers in 8051 microcontroller contain two special function registers.
Thus one can think of it as.
The 8051 has two timers timer 0 and timer 1.
They can be used as timers or as event counters.
However the counter only counts up to to either 256 8 bit counter or 65535 16 bit counter.
Every microcontroller has a clock oscillator say in arduino uno it is 16mhz.
That is a far cry from the 1 000 000 ticks per second that the standard avr microcontroller provides.
All three can be configured to operate either as timers or event counters.
Timer mode control tmod.
They can be used either as timers or as counters.
This is responsible for speed.
Both timer 0 and timer 1 are 16 bit wide.
Timers t0 and t1 completely fall under the 8051 standard.
Lower 4 bits are used for control operation of timer.
Tmod is an 8 bit register used for selecting timer or counter and mode of timers.