Timer Set-Up; Timer/Counter - Intel MCS 51 User Manual

Table of Contents

Advertisement

intel.
MCS@-51PROGRAMMER'SGUIDE AND INSTRUCTION SET
TIMER SET-UP
Tables 3 through 6 give some valuesfor TMOD whicheen be used to setup Timer Oin differentmodes.
It is assumedthat only one timer is beingused at a time. If it is desiredto run TimersOend 1simukaneoudy,in
snY
mod%
the valuein TMOD for Timer Omust be ORed with the value shownfor Timer 1 (Tables5 and 6).
For example,ifit is desired to run Timer Oin mode1GATE (externalcontrol),and Timer 1in mode2 COUNTER,
then the value that must be loaded into TMOD is 69H (09H from Table 3 ORed with 60H from Table 6).
Moreover.it is assumedthat the user, at this mint, is not ready to turn the timers on and will do that at a different
point in he programby setting bit T-Rx(in TCON)to 1.
-
TIMER/COUNTER O
As a Timer:
Table 3
MODE
o
1
2
3
""N
m
13-bit Timer
OOH
08H
16-bit Timer
OIH
09H
8-bit Auto-Reload
02H
OAH
two 6-bit Timera
03H
OBH
As a Counter:
Table 4
TMOD
MODE
COUNTER 0
INTERNAL
EXTERNAL
FUNCTION
CONTROL
CONTROL
(NOTE 1)
(NOTE 2)
o
13-bitTimer
04H
OCH
1
16-bitTimer
05H
ODH
2
8-bit Auto-Reload
06H
OEH
3
one8-bitCounter
07H
OFH
NOTES
1. TheTimeristurned ON/OFF
by
eettinglclearing bitTROinthesotlwere.
2. The Timeria turnedON/OFF
by
the 1 to Otransition o n ~
(P3.2)whenTRO= 1
(herdware c ontrol).
2-15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents