-->

Timers & 8051 Timer Programming

By

8051 microcontroller has two Timers designated as Timer0 and Timer1. 
Each of these timers is assigned a 16-bit register. 
The value of a Timer register increases by one every time a timer counts. 
Timer takes a time period of one machine cycle to count one. 
(Machine cycle is a unit that refers to the time required by the microcontroller to execute instructions.) 
This means that the maximum number of times a timer can count without repeating is 216, i.e., 65536
So the maximum allowed counts in value of Timer registers can be from 0000H to FFFFH. 
Since 8051 is an 8 bit controller, 
the registers of 8051 Timers are accessed as two different registers; 
one for lower byte and other for higher byte. 
For example, register of Timer0 is accessed as TL0 for lower byte and TH0 for higher byte. 
Similarly TL1 and TH1 are registers assigned to Timer 1.

More Posts

gElectron. Powered by Blogger.