Home of RF and Wireless Vendors and Resources

One Stop For Your RF and Wireless Need

Microcontroller Timers

80c51 Intel Microcontroller has Two 16-bit timers/counters, Timer 0 and Timer 1. TMOD and TCON registers are used for setting and using these timers/counters.

Both can be configured to operate either as timers or as event counters. In the case of timers, register is incremented once every machine cycle. Hence timer is considered as counter which counts machine cycles. One machine cycle has about 12 oscillator periods. The count rate is about (1/12)Oscillator frequency.

In the case of Counter, register is incremented in response to a 1-0 transition to its corresponding external input pin. In this function, the external input is sampled during S5-P2 of the every machine cycle.

Microcontroller TMOD register(Not bit addressable)

Microcontroller TMOD register

GATE- When GATE=1 and TRx(in TCON) is set, Timer/Counter-x will run while INT-x pin is
set high(Hardware Control). When GATE=0, Timer/Counter-x will run only
while TRx=1(software control).
C/(T)- Set 0 for timer operation and Set 1 for counter operation
M1- Mode Selector bit
M0- Mode Selector bit

M1 M0 Operating Mode
0 0 13 bit timer
0 1 16 bit timer/counter
1 0 8 bit auto-reload timer/counter
1 1 TL0 is an 8 bit timer/counter controlled by standard timer 0 control bits, TH0 is an 8 bit timer controlled by timer 1 control bits.

Microcontroller TCON register(Bit addressable)

Microcontroller TCON register

• TF1-TCON.7-Timer1 overflow flag
• TR1-TCON.6-Timer1 run control bit
• TF0-TCON.5-Timer0 overflow flag
• TR0-TCON.4-Timer0 run control bit
• IE1-TCON.3-External interrupt 1 edge flag
• IT1-TCON.2-Interrupt 1 type control bit
• IE0-TCON.1-External interrupt 0 edge flag
• IT0-TCON.0-Interrupt 0 type control bit

RELATED LINKS

• Microcontroller tutorial
• What is microcontroller
• 8051 Microcontroller Architecture
• Microcontroller hardware Interfacing

               


Share this page

Translate this page