EasyManua.ls Logo

Holtek BS82B12A-3 - Timer Modules - TM; Int�Od�Ction; TM Ope�Ation; TM Clock so

Holtek BS82B12A-3
168 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Rev. 1.20 68 January 23, 2015 Rev. 1.20 69 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
Timer Modules – TM
Oneofthemostfundamentalfunctionsinanymicrocontrollerdeviceistheabilitytocontroland
measuretime.ToimplementtimerelatedfunctionsthedeviceincludesseveralTimerModules,
abbreviatedtothenameTM.TheTMsaremulti-purposetimingunitsandservetoprovide
operationssuchasTimer/Counter,InputCapture,CompareMatchOutputandSinglePulseOutput
aswellasbeingthefunctionalunitforthegenerationofPWMsignals.EachoftheTMshastwo
individualinterrupts.TheadditionofinputandoutputpinsforeachTMensuresthatusersare
providedwithtimingunitswithawideandexiblerangeoffeatures.
ThecommonfeaturesofthedifferentTMtypesaredescribedherewithmoredetailedinformation
providedintheindividualCompactandPeriodicTMsections.
Introduction
Eachdevicecontainsa10-bitCompactTM,CTM,anda10-bitPeriodicTM,PTM.Although
similarinnature,thedifferentTMtypesvaryintheirfeaturecomplexity.Thecommonfeaturesto
theCompactandPeriodicTMswillbedescribedinthissectionandthedetailedoperationwillbe
describedincorrespondingsections.Themainfeaturesanddifferencesbetweenthetwotypesof
TMsaresummarisedintheaccompanyingtable.
Function CTM PTM
Timer/Counter
I/P Capture
Compare Match Output
PWM Channels 1 1
Single Pulse Output 1
PWM Alignment Edge Edge
PWM Adjustment Period & Duty Duty or Period Duty or Period
TM Function Summary
CTM0 PTM0
10-bit CTM 10-bit PTM
TM Name/Type Reference
TM Operation
ThetwodifferenttypesofTMsofferadiverserangeoffunctions,fromsimpletimingoperations
toPWMsignalgeneration.ThekeytounderstandinghowtheTMoperatesistoseeitintermsof
afreerunningcounterwhosevalueisthencomparedwiththevalueofpre-programmedinternal
comparators.Whenthefreerunningcounterhasthesamevalueasthepre-programmedcomparator,
knownasacomparematchsituation,aTMinterruptsignalwillbegeneratedwhichcanclearthe
counterandperhapsalsochangetheconditionoftheTMoutputpin.TheinternalTMcounteris
drivenbyauserselectableclocksource,whichcanbeaninternalclockoranexternalpin.
TM Clock Source
TheclocksourcewhichdrivesthemaincounterineachTMcanoriginatefromvarioussources.The
selectionoftherequiredclocksourceisimplementedusingthexTnCK2~xTnCK0bitsinthexTMn
controlregisters,where"x"canstandforCorPand"n"istheserialnumber.Theclocksourcecan
bearatioofeitherthesystemclockf
SYS
ortheinternalhighclockf
H
,thef
SUB
clocksourceorthe
externalTCKnpin.TheTCKnpinclocksourceisusedtoallowanexternalsignaltodrivetheTM
asanexternalclocksourceorforeventcounting.

Table of Contents

Related product manuals