The MC6840 is a programmablesubsystem componentof the M6800 Family designed to provide
variable system time intervals.
The MC6840 has three 16-bit binary counters, three correspondingcontrol registers, and a status
register. These counters are under software control and may be used to cause system interrupts
andlor generate output signals. The MC6840 may be utilized for such tasks as frequency measure-
ments, event counting, interval measuring,and similar tasks. The device may be used for square
wave generation,gated delay signals, single pulses of controlled duration, and pulse width modul~?~’’’*,., ~
tion as well as system interrupts.
,>~+
Order this document
by MC6840/D
MC6840
,:::’~”,<$,+
){t t,$.~t.+
\ “:tt+.:?.,:t:’i’
\.:?,\\,+,
,,,.F+\ ~!,;&~
.’\’ :,~>.,,,.~...~.
~:,~:;,~<~r...
....+
.+
,.,,.
~ L.4!:s+”
.<\;:
\ *Y>:”*.
~.\\,\.*;L*
“--’. ~.t.:~,,,
.$
‘$tt<v
.!,.
A),,),,
l.~:~:.*L~\,\.,,.l.,.,$..,
t,.,~ ,1..
~*:~\
.
Three
Three
MOTOROLA INC , 1988
@
MOTOROLA=
DS9802R3
BLOCK DIAGRAM
m
E (Enable)
t
&IRea,sterI
Clock
A
I
‘,~t..
J!{
The average chip-juncti~wt~~$erature, TJ, in ‘C can be obtained from:
where:
TA
OJA= +P@k~d’’ThermalResistance, Junction-to-Ambient,‘Cm
pD
PINT, !kd~~x Vcc, Watts — Chip Internal Power
Pp~T3W$=’*~ort Power Dissipation, Watts — User Determined
~ *;’.?,,*
~~$@~~#appliCatiOnSppORT<plNTandcan be neglected. ppORTmay become significant if the device is configured
.AQ&+$ve Darlington bases or sink LED loads.
~~~~%approximaterelationshipbetween PD and TJ (if PpORT is neglected) is:
,,
Solving equations (1) and (2) for K gives:
where K is a constant pertaining to the particular part. K can be determined from equation (3) by measuringPD (at
equilibrium)for a known TA, Using this value of K, the values of PD and TJ can be obtained by solving equations
(1) and (2) iteratively for any value of TA
= Arn~~~m\,fem peratu re, ‘C
,~~~~~+PpORT
.
,4 ~
.,>
,$>5, -*, $:
.,d:P:.. 3... ~
;.,
$i<
~.s>>,,
:<:*,
‘.~~..$.’
TJ =TA+(PD*OJA)
PD= K: (TJ +273°C)
● (TA+2730C) +0JNPD2
K=PD
—.
(1)
(2)
(3)
MOTOROLAMC6840
2DS9802R3
MAXIMUMRATINGS
Rating
SymbolValueUnit
Supply Voltage
Input VoltageV,n
Operating Temperature Range – TL to TH
MC~,MC~A40,MC~B40
MCWOC,M C6BA40C
Storage Temperature Range
THERMAL CHARACTERISTICS
CharacteristicSymbol
ThermalResistance
Vcc
TA
Tstg
9JA
to +7.0v
–0.3
to +7.0v
–0.3
Oto +70
–40to+85‘c
–55to+150‘c
ValueUnit
‘cm
This devtce contains
Inputs agatnstdamagedue to high static
voltages or electric fields, however,it IS advised that normal precautionsbe taken to
avoid applicationof any voltage higher than
max!mumratedvoltagestothishtghtmpedance
recommendedthat V,n and Vout be constrainedto the range VSSS(Vlnor Vout)
SVCC.Rellabllity of operationIS enhanced~,
unused Inputs are tied to an
voltagelevel (e g., eltner VSS or V@&$ , “’$.~
clrcult. For proper operationIt IS
Cerdip65
Plastic100
DC ELECTRICALCHARACTERISTICS(VCC = 5.o Vdc + 5%, VSS =0, TA= TL to TH unless otherwise noted) .,ih ~+.,
Characteristic
Input High Voltage
Input Low Voltage
Input Leakage Current (Vin =0 to 5.25 V)
HI-Z (Off State) Input Current (Vin= 0.5 to 2,4 V)
OutputHigh Voltage
(lL~ad=–205KA)
(l Load= –2~KA)Other Outputs
OutputLow Voltage
(l Load= 1.6 mA)
(l Load =3.2 mA)
Output Leakage Current (Off State) (VOH = 2.4 V)
Internal Power Dissipation(Measuredat TA= TL)
Input Capacitance
(Vln=O,TA=250C,f=l.OMHz)
OutputCapacitance
(V,n=O. TA=25°C,f=l.OMHz)
%.
.?
m,DO-D7 .2
+:$?1$$.,
tf\“$
>,,p.,~~.D7
“?l$~~fl others
>.
,:..>.’
Symbol
VIH
vlL
Iin
. ....
-..:*<>.
IRQ
:&s~’
ITS[
v O H,:.,.?
f’.$;:~$:,ii :,+
is‘i~~.-~,~.s~<
*(5. ‘*?
‘%Q#-
PINT
Ci”
Cn,,t
DO-D7
DO-D7
01-05?;
.,i.~‘$ILOH–
Min
VSS+2.O‘;’%-‘~ Vccv
v s s – Q,$ >?’~&:’
, .,,. ....
..5
~ .,t.
..,:<.>
.!,. $$J
,.,., ..}}:,
t$?,:::%:,::~”}:.
V~~+2.4
VSS+2.4
—
—
—
——
——
circuitryto protectthe
,’!>$:.,.:?.
T~,?..
I
“**$*l .0
~~ MaxUnit
VSS+O.8
2010pA
–
–
—
VSS+O.4
—
VSS+0,4
1.0
470
—
,.
AC OPERATINGCHARACTERISTICS(See Figure:Q~!%&;}$*
I
Characteristic
Input Rise and
(Fiaures 4 and 5) ~. ~, and RESET
Inuut Pulse Width Low (Figure 2)
‘~As~nchronousInput)-
C, G, and RESET
Input Pulse Width High (Figw&~~’s’pI-,
(AsynchronousInput) ~ii~~$Y
Fall Times
I .:cr-~~~I-
if“’.?:.:
!’+>
:’::$; ‘3:q>%WL
~,({,
~,
:
rvvH
I
1,
thd50
ion Time (Figure 7)
ln~~:pu]seWidth
C3’( – 8 Prescaler Mode On Iv)
Output Delay, 01-03 (Figure 5)
(VOH =2.4 V, Load B)
(V0H=2.4V,Load D)
(VOH=O.7VDD, Load D)
InterruptRelease Time (Figure 6)
tr and tfs tcvcE
TTL
MOStcm
CMOStcmos
tsvnc
pWL, PWH120
t
tco
tlR
$+...i$
..i:
kAPcaAn
1
I
tcyc E + tsu + thd–
tcVcE+ tsu + thd–
250
—
—
—
—
MC6BA40
Max
1.0”
,1[1
—
—
—
700
450
2.0
1.2
Min
—
tcycE+ tsu + thd–
tcycE+ tsu + thd–
50
2m
80
—
—
—
—
MaxMinMax
0.666.
—
—
—
460
450
1.35
0.9
MC6BB40
—
tcyc E + tsu + thd
tcVcE+ tsu + thd
w
175
60
—
—
—
—
appropr!atewt$~$.
~, f?.’:),:,
‘ \*,i
v
2.5
—
–
10
7W
12.5
75
5.0pF
PA
v
v
PA
mW
pF
—
Unit
O.w”
ns
–
ns
–
—
ns
—
—
ns
—
—
ns
—
ns
—
ns
Mo
ns
MO
1,0
Us
07
MC6840
DS9802R3
MOTOROLA
3
BUS TIMINGCHARACTERISTICS(COO~1-+=. I ~ --~ Q)
Ident.
Numbr
I
1
Cycle Time
Pulse Width,E Low
2
3Pulse Width,E High
4
Clock Rise and Fall Time
Q
Address Hold Time
4..
14
15
18Read Data
21
!
;s Setup Time Before E
Chip Select Setu
elect Hold Time
Chip Sf’‘“”
Write Data Hold Time
:ral OutputData Delay Time
sral Input Data Setup Time
Jp Time Before E
,.,,-
HoldI Ime
,UUGI“” LGa 1, z, a,, ” d,
Characteristic
MC6840
..linMaxMinMax
tcvc
PWEL4309W
PWEH4W9W
tr, tf
tAH
tAS
tcs
tCH
tDHR1201W01201~.
I
tDHW
tDDR
tDSW
1.0
—
10–10–
80–60–
80–60–
10–10–
10–10–
–290–
~~~—
MC68A40MC68840
MinMax‘nit
10
0.67100.510#s
28095002109m
2809m2209m
25–25
I
80
–20ns
10–ns
40–ns
40–
10
20 I~ Qs$f” ns
I
~,Q,$J*,p~;@I ns
I ,
180 .~~.~,’”~j $~] ns
ns
ns
Q:.ns
~
..,\:.;?:,‘*T:*.*}
MOTOROLA
4
~!, FI$URE2 – INPUT PULSE WIDTH LOW
FIGURE3 – INPUT PULSE WIDTH HIGH
—.
MC6840
DS9802R3
FIGURE4 – INPUT SETUP AND HOLD TIMES
FIGURE 5 – OUTPUT DELAY
‘esrpO’”’T
NOT E: Timing measurementsare referenced to and from a low voltage of 0.8 volts and a high voltage of 2.0 volts, unless otherwise noted.
MC6840
DS9802R3
L
I
—
300F
MOTOROLA
5
DEVICE OPERATION
The MCWis part of the Mmmicroprocessorfamily
and is fully bus compatiblewith MWOO systems.The three
timers in the MC~operate independentlyand in several
distinctmodes to fit a wide variety of measurementand synthesis applications.
TheMCWOis an integrated,setof threedistinct
counter/timers.It consistsof thre’e’ 16-bitdata latches,
three16-bitcounters(clockedindependently),and the
comparisonand enablecircuitrynecessaryto implement
various measurementand synthesis functions.In addition,it
containsinterruptdrivers to alert the processorthat a particular functionhas been completed.
In a typical application,a timer will be loaded by first storing two bytes of data into an associatedCounterLatch. This
data is then transferredinto the countervia a Counterinitializationcycle.If the counteris enabled,the counter
decrementson each subsequentclock period which may be
an external clock, or Enable (E) until one of several predetermined conditionscauses it to halt or recycle. The timers are
thus programmable,cyclic in nature, controllableby external
inputs or the MPU program,and accessibleby the MPU at
anv time.
BUS INTERFACE
The ProgrammableTimer Module(PTM) interfacesto the
M6BO0 Bus with an 8-bit bidirectionaldata bus, two Chip
Select lines, a Read/Writeline, a clock (Enable) line, and interruptRequestline,an externalReset line,and three
Register select lines. VMA should be utilized in conjunction
with an MPU addressline into a Chip Select of the PTM
when using the MC6800/6802/680B.
BIDIRECTIONALDATA (DGD7)– The bidirectional.data N
lines (DO-D7) allow the transferof data between
t~@skU
andPTM.The databus outputdriversare t~~$,~$ta$e
devices which remain in the high-impedance(Q@),%t$~~ exceptwhentheM PU performsa PTM~$~~~’~eration
(Read/Writeand Enable lines high and PT~~$~~~~;Welects activated).
:*.. i:;?:+
?,$ ?~ .
.,,.,
CHIP SELECT(CSO, CS1 ) – T@?e~?W7signalsare used
to activate the Data Bus interfa~{%k~llowtransfer of data
from the PTM.WithC~O = @~an$ CSI = 1, the device is
selected and data transfer,,$~’R~,~% fir.
‘yi
!$
READ/WRITE(R/~$+–“$%is signal is generatedby the
MPU to controlthaj-~%i~~ionof data transferon the Data
Bus. With the Pl~~$&lected,a low state on the PTM R/~
line enables the{~~tbuffers and data is transferredfrom the
MPU to the ~~~%nthetrailing edge of the E (Enable) clock.
Alternat~~T,J:&fider thesameconditions)R/~=1 and
Enabl@~$~#!lowsdata in the PTM to be read by the MPU.
>.:.+
*,,,.::>.i,,,.>.<,r
.,, ~
!~%~LE(E CLOCK)– The E clock signal synchronizes
da’~’;ansferbetweenthe MPU and the PTM. It also performs an equivalentsynchronizationfunctionon the external
clock, reset, and gate inputs of the PTM.
INTERRUPTREQUEST(~Q)– The active low Interrupt
Request signal is normallvtied directly (or throughpriority interruptcircuitry)to the ~input of the MPU. This is an
“open drain” output(no load device on the chip) which permits other similar interruptrequest lines to be tied togetherin
a wire-ORconfiguration.
Themline is activatedif, and onlv if, the Compositeinterrupt Flag (Bit 7 of the Internal Status Register) is asserted.
The conditionsunder whichthe ~Qline is activatedare
discussedin conjunctionwith the Status Register.
RESET – A low level at this input is clocked lnt~ !fi@ PTM
by the E (Enable) input.Two Enable pulses a~~.r~~~~dto
synchronizeandprocessthesignal.Th~ ~$~then
recognizesthe active “low”or inactive ~~l~t~~~&ti the third
Enable pulse. If the RESET signal is a~yw~~bus,an additional Enable period is requiredif SQ$U9 ttw$s are not met.
The RESET input must be stable ,&@$~P~$$~for the minimum
time stated in the AC Operating’;:$~,a]ecteristics.
Recognitionof a low level ~~~hlsh!~put by the PTM causes
the followingaction to o~c~s$~~
a. All counterlatch@’ ~r~;$reset to their maximum
values.
.JtQ,ff>
.,.,.&...,>,,?
,’i>:,,~:-....”.,$.,
b. All Control%${~~bitsare cleared with the exception
of CRIOJi~~ter~lreset bit) which is set.
c. All cofi’~$~<=.are preset to the contentsof the latches.
~:,$..,:~.~;j,,, .s.,<.,,>
d. All@ou~$er outputsare reset and all counter clocks are
.~;~$w.
.’:!..:?~
e.~$~Status Register bits (interruptflags) are cleared.
,>..:‘
:~”~:,~:.
RwlSTERSELECT LINES (RSO, RSl~RS2)– These in-
+’r~it,?
:,.,,
,!.i%:~~ts are used in conjunction with the R/W line to select the
““* “ Internal registers,countersand latches as shown in Table 1.
~t!~i.>.${\+i
~*~:\,, ,
.,,.
~t?
NOTE
The PTM is accessed via MPU Load and Store operations
in much the same manner as a memory device. The instructions availablewith the M6800 familyof MPUS whichper-
form read-modify-writeoperations on memory should not be
used when the PTM is accessed. These instructionsactually
fetcha byte frommemory,performan operation,then
restore it to the same address location.Since the PTM uses
the R/~line as an additionalregisterselect input,the
modifieddata will not be restoredto the same registerif
these instructionsare used.
CONTROLREGISTER
Each timer in the MC6B40 has a correspondingwrite-only
ControlRegister.ControlRegister #2 has a unique address
space (R SO= 1, RS=O,RS2=O)and thereforemay be written into at any time. The remainingControlRegisters (#1 and
#3) share the AddressSpace selectedby a logic zero on all
Register Select inputs.
CR20 – The least significantbit of ControlRegister #2
(CR20) is used as an additionaladdressingbit for Control
Registers #1 and #3. Thus, with all Register selects and R/~
inputs at logic zero, ControlRegister #1 will be writteninto if
CR20 is a logic one. Under the same conditions,Control
Register #3 can also be writteninto after a RESET low conditionhas occurred,since all controlregisterbits (except
CR IO) are cleared. Therefore,one may write in the sequence
CR3, CR2, CRI,
COUnt
MOTOROLA
6
MC6840
DS9802R3
TABLE 1 – REGISTER SELECTION
Register
select InputsOperations
RSIRSO
RS2
00
o0
o1
o11
1
0
1
0
11
1
1
CR20 = OWrite Control Register #3
0
CR20 = 1Write Control Register #1
1
Write Control Register #2
0
Write MSB Buffer Register
Write Timer #1 Latches
0
Write MSB Buffer Register
1
Write Timer #2 Latches
o
Write MSB Buffer Register
1
Write Timer #3 Latches
Rl~ = OR/ti = 1
CR1O – The least significantbit of ControlRegister #1 is
used as an Internal Reset bit. When this bit is a logic zero, all
timers are allowed to operate in the modes prescribedby the
remainingbits of the controlregisters.Writinga “one”into
CRIO causes all countersto be preset with the contentsof
the correspondingcounterlatches,all counterclocks to be
disabled,and the timer outputsand interruptflags (Status
Register) to be reset. Counter Latches and ControlRegisters
are undisturbedby an Internal Reset and mav be writteninto
regardlessof the state of CR IO.
The least significantbit of ControlRegister #3 is used as a
selector for a -8 prescaler which is available with Timer #3
onlv. The prescaler,if selected,ISeffectivelyplaced between
CR30 Timer #3 Clock Control
O T3 Clock is not prescaled
1 T3 Clock is prescaled bv – B
x=3
I
MOTOROLA
7
ControlRegister Bits CR1O, CR20, and CR30 are unique in
that each selects a differentfunction.The remainingbits (1
through7) of each ControlRegister select commonfunctions, with a particularControlRegister affectingonly its correspondingtimer.
CRX1–Bit 1 of ControlRegister#1 (CR11 ) selects
whetheran internalor externalclock source is to be used
with Timer #l. Similarly,CR21 selects the clock source for
Timer #2, and CR31 performsthis functionfor Timer #3. The
functionof each bit of ControlRegister “X” can thereforebe
definedas shown in the remainingsection of Table 2.
CRX2 – ControlRegister Bit 2 selects whetherthe binary
informationcontainedin the CounterLatches(and subsequentlyloaded into the counter)is to be treated as a single
16-bit word or two 8-bit bytes. In the single 16-bit Counter
Mode (CRX2= O) the counterwill decrementto zero after
N + 1 enabled [G= O)clock periods, where N is defined as the
16-bit numberin the CounterLatches.WithCRX2=1, a
similarTimeOut will occurafter(L+ I)*(M + 1) enabled
clock periods,where L and M, respectively,refer to the LSB
and MSB bytes in the CounterLatches.
CRX3-CRX7– ControlRegister8its 3, 4, and 5 are ex-
plained in detail in the Timer OperatingMode section.Bit 6 is
an interruptmask bit whichwill be explainedmore fully in
conjunctionwith the StatusRegister,and bit 7 is used to
enable the correspondingTimer Output.A summaryof the
controlregister programmingmodes is shownin Table 3.
STATUSREGISTER/lNTERRUPTFLAGS
The MC~has an internalRead-OnlyStatusRegister
which contains four InterruptFlags, (The remainingfour Qts
of the register are not used, and defaultsto zeros whe~~~;
ing read.; Bits O, 1, and 2 are assigned to Timers 1, 20,3NQ @
respectively,as individualflag bits, while Bit 7 is a,<$o<~~~$~te
InterruptFlag. This flag bit will be asserted if{~~~$~’~<$~e individualflag bits is set while Bit 6 of the cor~~sw~$~$fig Control Register is at a logic one, The condil~~~;~~rasserting
the compositeInterruptFlag bit can thwqfd~be expressed
as:
0 0 Frequency Comparison Mode: Interrupt If Gate ~is< Counter Time Out
1
1 0
o
1
0 Pulse Width Comparison Mode: Interrupt if Gate
1
0 1
o
0 1 Frequency Comparison Mode: Interrupt If Gate ~Is> Counter T!me Out
1
1 1
o
1 1 Pulse Width Comparison Mode: Interrupt If Gate $~ is> Counter Time Out
1
Continuous Operating Mode: Gate 1 or Write to Latches or Reset Causes Counter Initialization
Continuous Operating Mode: Gate 1 or Reset Causes Counter Initialization
Single Shot Mode: Gate J or Write to Latches or Reset Causes Counter Initialization
Single Shot Mode: Gate I or Reset Causes Counter Initialization
TABLE 3 – PTM OPERATING MODE SELECTION
An interruptflag is cleared by a TimerReset con@tion,
i.e., ExternalRESET=Oor InternalReset Bit (CR1O)= 1. It
will also be cleared by a Read Timer Counter Commandprovided that the Status Register has previouslybeen read while
the interruptflag was set. This conditionon the Read Status–
Register-ReadTimer Counter(R S-RT) sequence is designed
to preventmissinginterruptswhichmightoccur after the
An IndividualInterruptFlag is also clearedby a Write
Timer Latches (W) commandor a CounterInitializqtf@ie (Cl)
sequence,providedthat W or Cl affectsthe,,,l~’~&~correspondingto the individualInterruptFlag,
,<+i.\.*““.’]:i, ..
COUNTERLATCH iNITIALl~TION
~“t?<:?f{,,~.~~,~
~,~y$..~+
$!
;%
y>.<W,:+$*11:
,,.+,.\ .,.
,<.:
Each of the three Independenttim~$~~~~~stsof a 16-bit
addressablecounterand a 16-bi$e~~~@sablelatch.The
counters are preset to the binary n~b~rsstored in the latches. Counterinitializationres~+l~~kin Ne transfer of the latch
contentsto the counter.~~}~Q@sin Table 4 regardingthe
binary numberN, L, or$@~~*dinto the Latches and their
relationshipto the ~,~~~,~,.waveformsand counterTimeouts.
.,.~:2,
>.b‘.3*
:..~:..<~.$,,,,\\,,,
Since the PT~,,da;~:$usis 8-bits wide and the countersare
16-bits wide, ~~~boraryregister (MSB BufferRegister) is
provided.iFmi$~~write
Signific(~tt.Q~]~of the desiredlatch data. Three addresses
are pr&~J~~~orthe MSBBufferRegister(as indicated
only”registeris fortheMost-
in
Ta&e 1), %ut they all lead to the same Buffer.Data from the
Wy&$JBufferwill automaticallybe transferredinto the Most-
f$?$niflcantByte of Timer #X when a Write Timer #X Latches
.$
‘~$.,~$~kmandis performed.So it can be seen that the MC6840
f$~~~;hasbeen designed to allow transfer of two bytes of data into
“3the counterlatchesprovidedthat the MS B is transferred,-
>.!&
first. The storage order must be observedto ensure proper
latch oDeration.
In many applications,the source of the data will be an
M6800 Family MPU. It should be noted that the 16-bit store
operationsof the M68~familymicroprocessors(STS and
STX) transfer data in the order required by the PTM. A Store
Index Register Instruction,for example,results in the MSB
of the X register being transferredto the selected address,
then the LSB of the X register being writteninto the next
higherlocation.Thus,eitherthe indexregisteror stack
pointermay be transferreddirectlyinto a selectedcounter
latch with a single instruction,
A logic zero at the RESET input also initializesthe counter
latches.In this case, all latcheswill assumea maximum
countof 65,53510.It is importantto note that an Internal
~# Is< Counter Time Out
—
MOTOROLA
8
MC6840
DS9802R3
Reset (Bit zero of ControlRegister 1 Set) has no effect on
the counterlatches.
CLOCK INPUT C= ( + 8 PRESCALERMODE)– External
clock Input ~representsa special case when Timer #3 is
programmedto utilize its optional-8 prescaler mode.
Y
Counter Initializationis defined as the transfer of data from
the latches to the counter with subsequentclearing of the individualInterruptFlag associatedwith the counter.Counter
Initializationalwaysoccurswhenaresetcondition
(R ESET=Oor CR1O= 1) is recognized.It can also occur –
dependingon Timer Mode– with a Write TimerLatches
commandor recognitionof a negative transitionof the Gate
input.
Counterrecyclingor re-initializationoccurswhena
negativetransitionof the clock input is recognizedafter the
counterhas reachedan all-zero state. In this case, data IS
transferredfrom the Latches to the Counter.
ASYNCHRONOUSlNPUT/OUTPUTLINES
Each of the three timers within the PTM has external clock
and gate Inputs as well as a counteroutputline. The inputs
COUNTERINITIALIZATION
The divide-by-8prescaler containsan asynchronousripple
counter;thus, input setup (tsu) and hold times (thd) do not
apply. As long as minimuminput pulse widthsare maintained, the counterwill recognizeand processall iriput clock
(~)transitions.However,in order to guaranteethat a clock
transitionis processedduring the currentE cycle, a certain
amountof synchronizationtime (tsYnc) is required bef~en
the ~3 transitionand the falling edge of Enable ($$~~~&te
9). If the synchronizationtime requirementis n~t~~~itis
possible that the ~ transitionwill not be pro,Ge~~&&ntilthe
followingE cycle.
~;t‘~’,:.e.\\”s::,
.<*,+?**.t~~
The maximuminput frequencyand +[~:~ak+~ duty cycles
for the-8prescalermodeare :w~~@underthe AC
OperatingCharacteristics,lnternall~$.th~‘-8prescaler output is treated in the same manng$~s th~previouslvdiscussed
..*.,\**,
clock in~uts
are high-impedance,TTL-compatiblelines and ouputsare
capable of driving two standardTTL loads.
——
——
CLOCK INPUTS(Cl, C2, and~)– Input pins Cl, C2,
and ~willaccept asynchronousTTL voltage level signals to
decrementTimers 1, 2, and 3, respectively.The high and low
levels of the externalclocks must each be stable for at least
one system clock period plus the sum of the setup and hold
times for the clock inputs,The asynchronousclock rate can
vary from dc to the limit Imposed by the Enable Clock Setup,
and Hold times.
The external clock inputs are clocked In by Enable pulses.
Three Enable periods are used to synchronizeand process
-,
the external clock. The fourthEnable pulse decrementsthe
internal counter.This does not affect the input frequency,,,$f
merely creates a delay betweena clock input transitioK$&~~<,
accept asvnchronous~j~-~wrnpatlblesignals which are used
as triggersor cl~~$lga%~~g functionsto Timers 1, 2, and 3,
respectively,Th$~.$Y4mg inputs are clocked into the PTM bv
the E (enab~~’’b~b%in the same manneras the previously
‘~~.’~.~:t.,
discusse,~~,~~~~ffiputs.That IS, a Gate transitionis recognized by,,th5~$~tTM on the fourthEnable pulse (providedsetup
anq:$~ldtlrne requirementsare met), and the high or low
J,%:~~.the Gate input must be stable for at least one system
,+~oc~periodplus the sum of setup and hold times.All
$~~~~:~~?$rences to G transitionin this documentrelate to Internal
**,. recognitionof the Input transition.
The Gate inputsof all timersdirectlyaffect the internal
16-bit counter.The operationof ~ is thereforeIndependent
of the -8prescaler selection,
referencesto C inputsin this documentrelate t,~:lfi$$r~~l
recognitionof the input transition,Note that a Q~&$~fi~~~ or
low level which does not meet setup and hol~i~,~~!~~cifications may require an additionalEnable puls~:J,&~?~Wognltion.
When observingrecurringevents, a lack{~~, ~~o~hronization
will result in “jitter”being observed+:f~Jh&Y’outputof the
PTMwhenusingasynchronou:,,%/@$and gateInput
signals. There are two types of ji~er.$System jitter”is the
- ..**,
result of the Input signals be~&ti~*8i~synchronizationwith
Enable, permittingsignal:$wlt~~ginalsetup and hold time
to be recognizedby eith.~~~eblttime nearest the input transition or the subseque~~’%~~+dme.
“Inputjitter”ca~%$~great as the time betweeninput
signal negative ,gw${ansitionsplus the svstem jitter, if the
first transitiq~.<?~$ecbgnizedduring one systemcycle, and
recogni$~d~’~next cycle, or vice versa. See Figure 9.
not
Enable~~
I“p”t~~
Recog
Input
,k..i:~+i:l?!:!?,,.+.s,::”
J%
,i~$:
.$.,y)i~
,i~,:i:>
.$,*,,,. *,!,
.::,.,~,.,”..~\
.%),:.
.,>?$,..t
Either. ~
Here
FIGURE 9 – INPUT JITTER
+
~System
TIMER OUTPUTS(01, 02, 03) – Timer outputs01, 02,
and 03 are capable of drivingup to two TTL loads and produce a definedoutputwaveformfor either Continuousor
Single-ShotTimer modes. Output waveformdefinitionISaccomplishedbv selectingeither Single16-bit or Dual 8-bit
operatingmodes.The Single16-bit mode will producea
square-waveoutputin the continuousmode and a single
pulse in the single-shotmode. The Dual 8-bit mode will produce a variable duty cycle pulse in both the continuousand
single-shottimer modes,One bit of each ControlRegister
(CRX7) is used to enable the correspondingoutput.If this bit
is cleared, the output will remain low (VOL) regardless of the
operatingmode.If it is cleared while the outputIS high the
outputwill go low during the first enable cycle followinga
write to the ControlRegister.
The Continuousand Single-ShotTimerModes are the
onlv ones for whichoutputresponse is definedin this data
sheet. Refer to the ProgrammableTimer Fundamentalsand
Applicationsmanual for a discussionof the output signals in
othermodes.Signalsappearattheoutputs(unless
CRX7=O)duringFrequencyand Pulse Widthcomparison
modes, but the actual waveformis not predictablein typical
applications.
MC6840
DS9802R3
MOTOROLA
9
TIMER OPERATINGMODES
The MCWOhas been designedto operate effectivelyin a
wide variety of applications.This is accomplishedby using
three bits of each control
to definedifferentoperatingmodesof the Timers.These
modesare dividedinto WAVESYNTHESISand WAVE
MEASUREMENTmodes, and are outlinedIn Table 4.
TABLE 4 – OPERATING MODES
Control Register
CRX3CRX4CRX5
o“
o‘
1
0.
1
. Defines Add!tlonal Timer FunctionSelectIon
One cf the WAVESYNTHESISmodes IS the Continuous
Operatingmode, which is useful for cvclic wave generation.
Eithersymmetricalor variabledutycyclewavescan be
generatedin this mode. The other wave svnthesismode, the
Single-Shotmode,is similarIn use to the Continuous
operatingmode, however,a single pulse is generated,with a
programmablepreset width.
The WAVEMEASUREMENTmodes include the Frequency Comparisonand Pulse WidthComparisonmodes which
are used to measure cyclic and singular pulse widths,respectively.
In additionto the four timer modes in Table 4, the remaining control register bit is used to modify counter initialization
and enablingor interruptconditions,
WAVESYNTHESISMODES
CONTINUOUSOPERATINGMODE(TABLE5k/f#$~\he
continuousmode will synthesizea continuous
periodproportionalto the preset numberim~$~~t~dtticular
timer latches. Any of the timers in the PTM ~$$&’”programmed to operate in a continuousmode ~~h~,~tr~zeroes into
bits 3 and 5 of the correspondingco~~~o~k$$ster.Assuming
1“
register (CRX3, CRX4, and CRX5)
Timer Operating Mode
o
1
Con?lnuous
Single-Shot
Frequency Comparison
Pulse Width ComDarlson
‘$, k. ‘?’s.
Svntheslzer
Measurement
,+*<
.)P\::*
,.~
~*\+,,>
,&’~:ye’~itha
that the timer outputis enabled(CR X7= 1), either a square
wave or a variable duty cvcle waveformwill be generatedat
the Timer Output,OX, The type of outputis selectedvia
ControlRegister Bit 2.
Either a Timer Reset (CR1O= 1 or External Reset=O)con--
dition or internalrecognitionof a negativetransitionof the
Gate input results in CounterInitialization.A WriteTimer
latches commandcan be selected as a Counter Initialization
signal bv clearingCR X4.
The counter
conditionand a logic zero at the Gate Input.1~,’%s’’pk5-blt
mode,tke counterWIII decrementon the flr~$’~~~~cycle
during or after the counterInitlallzatloncvcl~~~~~%nuesto
decrementon each clock signal so long as.$~~~@alns low and
no reset conditionexists. A Counter Ti.@e,~&&~$the first clock
after all counterbits = O) results in~~~x~~l~dlvldualInterrupt
Flag being set and relnitlallzatlon.~~f~’’~ounter.
In the Dual 8-bit mode (C RX2A= tk~~ferto the example n
Figure 10 and Tables 5 and 6~$%~$.MSB decrementsonce for
everv full countdownof t~$~~$~+1. When the LSB = O, the
MSB is unchanged;on~~~n$$xtclock pulse the LSB
to thecountin l~~k.~s~Latches,andtheMSBIS
decrementedby 1 (oR%). *he output,If enabled,remains low
duringand af~~j~itiaflzationand
counterM,$,Q~?$~~~~>eroes. The outputwill go high at the
beginning$f t$ ‘fiext clock pulse. The outputremains high
until b@$~$~k$&SB and MSB of the counter are all zeroes. At
*..+,,,?!
thei~egmlngof the next clock pulse the defined Time Out
(~@~~wIll occur and the output WIII go low. In the Dual 8-bit
~.~~d$~~he period of the outputof the examplein Figure 10
,thr,~:~w,~tildspan 20 clock pulses as opposedto IW6 clock pulses
3&$~~~3ingthe normal 16-bit mode
@.$<,.
“A special time-outconditionexists for the dual 8-bit mode
,~~
,,,,:2
~’~.,~
(CR X2= 1) if L=O. In this case, the counterWIII revert to a–
mode similar to the single 16-bit mode, except Time Out occurs after M + 1‘ clock pulses. The output,if enabled,goes
low during the CounterInltlallzatloncycle and reverses state
at each TimeOut.The counterremainscyclical(Is reinitializedat each Time Out) and the IndlvldualInterruptFlag
is set whenTimeOut occurs.If M = L=O,the Internal
countersdo not change,but the outputtoggles at a rate of
fi the clock frequency.
IS enabledby an absenceof a TimeA~~eset
‘<t,~<&<,)*.+:‘
WIII remain low until the
IS reset
MOTOROLA
10
——
MC6840
DS9802R3
——
TABLE 8 – FREQUENCYCOMPARISONMODE
Mode
Frequencv
Comparison
Pulse Width
Comparison
Bit 3Bit 4
1
1
1
111
Control Reg.
0
0
10
Bit 5
0
1
CounterCounter Enable
Initiahzation
~ .j. ~+TO)+ R
~1 .~+ R
●T+ R
RI
c! .T+F
Flip-Flop Set (CE)
~ .~.~.r
———-
GI. W.R. I
————
GIW. R. I
————
GI. W.R. I
Counter Enable
Flip-Flop Reset (CE)
W+R+I
W+R+I
W+ R+I+G
W+ R+I+G
Interrupt Flag
sat (1)
al Before TO
TO Before ~1
Et Before TO
TO Before ~t
PIN ASSIGNMENT
MC6840
DS9802R3
023
rz4
a5
036
=722D3
RESET8
m9
-/1
RSO 10
RS11118D7
12
RS2
R/~1316CS1
vc~14
u
26~
25DO
24D1
23D2
21D4
20D5
19D6
17
E
15 CTO
MOTOROLA
13
The three differencesbetweenSingle-Shotand Continous
.—
... .. ..
Timer Mode can be summarizedas attributesof the Single-
Shot mode:
1, Outputis enabled for only one pulse until it is reinitializ-
ed.
2. CounterEnable IS independentof Gate
3. L= M =0 or N =0 disables output.
Aside from these differences,the two modes are identical,
WAVEMEASUREMENTMODES
TIME INTERVALMODES– The Time Interval Modes are
the FrequencV(period) Measurementand Pulse WidthCorrparisonModes,and are providedfor those applications
whichrequiremore flexibilityof interruptgenerationand
CounterInitialization.IndividualInterruptFlags are set In
these modes as a functionof both CounterTime Out and
transitionsof the Gate Input. Counter InitializationIS also affected bv InterruptFlag status.
A timer’s outputis normallynot used in a Wave Measurement mode, but it IS defined.If the outputis enabled,[t will
operate as follows.During the period betweenrelnitialization
of the timer and the first Time Out, the outputwill be a
logical zero. If the first Time Out is completed(regardlessof
Its methodof generation),the output will go high. If further
TO’s occur, the outputwill change state at each completion
of a Time-Out.
The counterdoes operate in either Single16-bit or Dual
8-bit modes as programmedbv CRX2. Other features of the
Wave MeasurementModes are outlinedin Table 7.
FrequencyComparisonOr PetiodMeasurementMode
(CRX3=1, CRX4=O)– The FrequencyComparisonMode
with CR X5= 1 is straightforward.If Time Out occurs prior to
the first negative transitionof the Gate input after a Count@r
Initializationcvcle,an IndividualInterruptFlag is set. *Q,
counterISdisabled,and a Counter Initializationcvcle ~a~~o’~’
begin u~il the interruptflag is cleared and a nega$j$e~dn5~tion on G is detected.
If CR X5= O, as shownin Tables 7 and 8,,@~{~,;,W~uptIS
‘i?.$\\@\,.,...?.,
,2,,,,,+,:,,...‘+!.\.
~$l~.y,,+::
~.’l, ..,<.,,,
generatedif Gate input returns low prior tq$’$w’’Out.If a
CounterTime Out occurs first, the coukh~fi$r~cvcled and
continuesto decrement.A bit is set ~~ht$~~ti%e timer on the
initial Time Out which precludesfw.tm~+$dividualinterrupt
*3),~.’‘::,,
,,
,,,:
generationuntil a new CounterInitializationcycle has been
completed.When this internal bit is set, a negative transition
of the Gate input starts a new CounterInitializationcvcle.
~TOis satisfied,since a T[me Out
(The conditionof ~1
●
hasoccurredandnoindividualInterrupthasbeen
generated. )
AnV of the timers withinthe PTM may be programmedto
comparethe period of a pulse (givingthe frequencvafter
calculations)at the Gate inputwith the time periodrequestedfor CounterTime Out. A negative transition~f the
Gate Input enablesthe counterand starts a Coq{]J~$,J,nitlallzatloncvcle — providedthat other condltlon~~+
a’9~m8Ed
in Table 8, are satisfied.The counterdecreme$~s~%veach
clock signal recognizedduring or after Cou<~~##i\~~M’llzation
until an Interruptis generated,a Write Tj*”@~hescommand is Issued, or a Timer Reset condl$j~’~o~;flrs.It can be
seen fromTable8 thatan inte(.[*@~<~@fidltionwillbe
generated(f CRX5=0and the pe~~d ,~f ’the pulse (single
pulse or measuredseparately[d~etid-w’ pulses) at the Gate
input is less than the Count8{~~*,0utperiod. If CR X5= 1,
an interruptis generatedJ&~$&~verseIS true.
Assumenow with Ct$,%$=~$ that a CounterInitialization
has occurredand tha$i~~fl~~teinput has returnedlow prior
to Counter Time ,Q,ut.’’Q~nce there is no IndividualInterrupt
Flag generated,,~~~]$$ ~,utomatlcallystarts a new CounterinitializationC@~~$$~eprocess will continuewith frequencv
comparis~o~$e~,~$performedon each Gate input cvcle until
the mo~,~schanged,or a cvcle is determinedto be above
the ~~de~.minedlimit.
.4:.\,.;*.,,
h.,~,~.a
&*’~ls#WidthComparisonMode (CRX3=1, CRX4= 1) -
+&,~$~&~rnode is similar to the FrequencV ComparisonMode ex-
.t$:\\tfw>::
~.(..,.~ept for a positive,rather than negative,transitionof the
““>?Gate input terminatesthe count.With CRX5= O, an lndivld-
f}‘~
ual InterruptFlag will be generatedif the zero level pulse
applied to the Gate input is less than the time period required
for Counter Time Out, With CRX5= 1, the interruptis generated when the reverse conditionis true.
As can be seen in Table 8, a positive transitionof the Gate
input disablesthe counter.WithCR X5= O, it IS therefore
possible to directlv obtain the width of anv pulse causing an
interrupt.Similardata for other Time IntervalModes and
conditionscan be obtained,if two sectionsof the PTM are
dedicatedto the purpose.
....s.
.,,,,.s%}::,:,?
.,>,,,\
qj>~,, ; i~,
<,:.-.,,.
~:<$.,F
>,,>,,
‘t..,
MOTOROLA
12
.J:>!,
!:
:k:\\
\3..x/~ ~s~ij,.\$
.’.
c q,%~,:;
.J*, . ~ .
‘\y,.,,,.~l)+
,,,.8’J
‘\~.>;.
“,’:*+ii
‘[:0
;~j
t
1
?;/,,
+:::,
,.,,
~,,/+.’
,.:$,<‘‘.
: 5*X5
s.
“
FrequencyComparison
o
FrequencyComparison
1
Pulse WidthComparison
o
Pulse WidthComparison
1
Application
FIGURE 7 –
OUTPUT DELAY
cRX3 = 1
Conditionfor SettingIndividualInterruptFlag
InterruptGeneratedif GateInputPeriod(l/F)is less
than CounterTime Out (TO)
InterruptGenerated!f Gate InputPeriod(1 /F) is greater
(Continuous Dual 8-Bit Mode Using Internal Enable)
“Time
Example:Contentsof MSB = 03 = M
Contensof LSB = 04 = L
out
I
~M(L+l)+l~L4
~
----
I
CounterOutput
Enable
(System 02)
(M + 1)(L+1) = Period
M(L + 1) + 1 = LOW portionof period
L = Pulse width
*Preset LSB and MSB to Respective Latches on the negattve trans[f~o~!ofthe Enable
* *Preset LSB to LSB Latches and DecrementMSB bv one on th~~;~~,ti;$transitionof the Enable
Y
The tilscussionof the ContinuousMode has assumed that
the applicationrequires an outputsignal. It should be noted.*Flag and re-initializationof the counter.
~1A~m‘L1
I
_l+L~,+L~l+L~~L
5 Enable
Pu Ises
I
I
I
I
*
I
I
T
.
that the Timer operates in the same manner with the out~ti%$,,
disabled(C RX7=O).A Read TimerCountercomman&~s‘*:
valid regardless of the state of CR X7.
SINGLE-SHOTTIMER MODE – This mode~st~%’~%$’al to
the ContinuousMode with three exceptioq~’$~$$first ofmode.If L= M=O(Dual 8-bit) or N=O(Single 16-bit), the
these is obviousfrom the name – the o~~pu~it~turnsto a
low level after the initial Time Out a~~:r~w~nslow until
anotherCounterInitializationcyclec,$$~~s,$
As indicatedin Table 6, the inte$~a~~ountlngmechanism
remains cvclical in the Single-$@@~;~@de.Each Time Out of
syb$h~;s’m
‘Q~,\
..,, .$\~(CRX3 ‘0, CR X7= I, CRX5= 1)
<$~$~~~1 RegisterInitialization/Output Waveforms
..@ r ;?*X2
$,
Yi*, >’
‘i<**.J:$~ !.l:.,
~}.:
$<,*‘<tfr:$,.
kw+~s,,%.
‘..~>::,
.,:,.-:.
,,\\\:
~%
.,.
:..i$>%
~t,-:.
00
01
>J:,i.
$1’::,+.,
~’ ,*)
\
-~$>;,<>
CRX4
.:..$.., .,
,,,.
“des
‘,*
“:’:::.:.,:,,~
TABLE 6– SINGLE-SHOTOPERATING MODES
I
Counter InitializationTimer Output (OX)
~L+W+R
~$+R
AlgebraicExpression
03(04+1)+ 1 =
16 Enables
5 Enable
I
Pulses
I
Ii
1[
II
II
II
~
,+.:.{..’
~?$:J?.S:J:>.
‘ ‘k’.“‘“’”
,$.:J’?.,, !,$.
,.. \i-
.+::i~\*\$:).\,,.,
SINGLE-SHOTMODE
II
1:
l\
II
II
,:. ?.,.* ‘$
,,,,:..,5,,,,L,X
II
5 Enable,I4 Enable
Pulses
II
II
1,
(M+l)(L+l)
id:
ki\\,k..,&’””
..
~~”h‘:$s~$, ,$y
,*,,, .,\.,..,
.t,te
t$~,)?it$,<;,}
+U
*the counterresults in the setting of an IndividualInterrupt
A l& br$l&” E xpression
..$j~9f$?y\(03+ 1) = 20 Enable or
,+, +$&ternalClock Pulses
.$.*\$k
k
Pu Ises$~,k
+$?~ ..,,,f,?
,.
:’?$}>
.::>.,,+
~1 + LV,*J:,,::’””i.
,
5 E q,~j:~k$!,
[ p u+!?~~ ,*S
Il.,
~.~:: .?$>.
\
‘.’’*:..{:,
,,s~?p%k&*$
.,:-” ,,,,,iv ‘
*’.$&*J, !,:.
..$,. \\.*
..!:,.:
;
,.i:
The second major differencebetweenthe Single-Shotand
Continuousmodes is that the internal counterenable is not
dependenton the Gate input level remainingIn the low state
for the Single-Shotmode.
Anotherspecial conditionis Introducedin the Single-Shot
outputgoes low on the first clock received during or after
CounterInitialization.The outputremainslowuntilthe
OperatingMode is changedor nonzerodata IS writtenInto
the Counter Latches. Time Outs continueto occur at the end
of each clock period.
~F_y’N+l’T’lo
J
‘ ~$~~$
$~’:~..
>$’,i
2.4 V
v . “*Q.
0.4
~,~+s~’.
<~:;*:>~~(~
\\ ,,,>:!$
,<~~t~
,,
@kr.\:27,,
.b,;:t. .:6
~;,?*,
MC6840
DS9802R3
1
11
0
6J +W+R
5$+R
Symbols are as defined in Table 5.
~(L+’’(q::~’L’)(M+’’(T)~
lo
TO
TO
MOTOROLA
11
PACWGE DIMENSIONS
fin AA
nfitinfinfifi
h
,8
h
,,,,
L:
A
--H–-G-- ----
r:,3;:E:;”’
F
D SF*T,,Z- —~
c-
Ni
,
4
,
K
?,l,,[
L-
NOTES:
1. POSITIONAL TOLERANCEOF LEAOS (01,
SHALL BE WITHIN 0.25rnrn(0.OID) AT
MAXIMUM MATERIALCONOITION, IN
RELATION TO SEATING PLANE ANO
EACH OTHER.
2, OIMENSION L TO CENTER OF LEAOS
WHEN FORMEO PARALLEL.
3. OIMENSION B DOES NOT IN CLUOE
MOLO FLASH.
\
~ ---
NOTES
1. OIM ~IS OAT,&~
2. POSITIONALT~j~~O+&&,AOS:
4 DIM A&#Q$>J,N5~UOESMENISCUS.
5 OIM ~k::YY&*ENTEROF LEA05
6. OIM~&lONINGAN OTOLERANCING
,,~~ PER ~NSl Y14.5, 1973.
—
P SUFFIX
PLASTICPACKAGE
CASE 71002
S SUFFIX
CERDIP PACKAGE
CASE 7S01
rA
-+y[f~k~
~G~
.+
, ,i$: ,ij”~
“ %;;* “i,<,!l
~::~,,
,!t, \*t:
.<%:,i,,$,,.i,.
.“,?:*
J’$!
.. ~.,,
~~.’,>.
‘$:s:,:, ,,$$
.1:$...{J:+‘\.:;$.
~.{?::\\,
,:.,:$
:,,.~> ‘~
.,,
~>$t.
,,\i.$,$$<\.**...F?’
~,$ii,
.,ii:~:!:it:<-,:,,
kb,
“*{*,t
..}
‘\\ k*i:.. ,
:,$,,;;,:..!’,
hotorolareservesthe right to make changes withoutfurther notice to any productsherein to improvereliability,functionor design. Motorola
does not assume any Iiabilitv arising out of the applicationor use of anv product or circuit describedherein; neither does it convev any license
under its patent rights
intended for surgical implant into the body or intended to support or sustain life. Buver agrees to notify Motorola of anv such intended end use
whereupon Motorola shall determine availability and suitability of its product or products for the use intended. Motorola and @ are registered
trademarks of Motorola, Inc. Motorola, Inc. is an Equal Employment Opportunity/AffirmativeAction EmploVer.
Literature Distribution Centers:
USA: Motorola Literature Distribution; P.O. Box 20912; Phoenix, Arizona 85036.
EUROPE: Motorola Ltd.; European Literature Center; 88 Tanners Drive, Blakelands Milton KeVnes, MK145BP,England.
ASIA PACIFIC: Motorola SemiconductorsH.K. Ltd.; PO. Box 80300; Cheung Sha Wan Post Office; Kowloon Hong Kong.
nor the rights of others. Motorola products are not authorized for use as components in life suppofl devices or systems
-)~jjFL ‘1
::wD*t,>+
F
?:i:,
,>,
..! .“$v$>>t.$?:’
~y”’“ -.::::
~,::.
.,*‘.,’!!.,.~~.:..~<..,,.,,
,.,, . .
,$$.
‘~,,:t,
.*:,*
i,,,
,)$
..,.>
+:\
~M
I
-.
-M
o
.-,,,,5., ,.,.,,, 1,“,.
MOrOROLA
7-88 IWERW.=0C578Z4 5.WOYCACM
MC6840
DS9802R3
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.