EasyManua.ls Logo

Holtek HT66F20 - Timer Modules - TM; Introd�Ction

Holtek HT66F20
294 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. 2.50 98 June 22, 2017 Rev. 2.50 99 June 22, 2017
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
HT66F20/HT66F30/HT66F40/HT66F50/HT66F60
HT66FU30/HT66FU40/HT66FU50/HT66FU60
A/D Flash MCU with EEPROM
Programming Considerations
Withintheuserprogram,oneoftherstthingstoconsiderisportinitialisation.Afterareset,allof
theI/Odataandportcontrolregisterswillbesethigh.ThismeansthatallI/Opinswilldefaultto
aninputstate,thelevelofwhichdependsontheotherconnectedcircuitryandwhetherpull-high
selectionshavebeenchosen.Iftheportcontrolregisters,PAC~PGC,arethenprogrammedtosetup
somepinsasoutputs,theseoutputpinswillhaveaninitialhighoutputvalueunlesstheassociated
portdataregisters,PA~PG,arerstprogrammed.Selectingwhichpinsareinputsandwhichare
outputscanbeachievedbyte-widebyloadingthecorrectvaluesintotheappropriateportcontrol
registerorbyprogrammingindividualbitsintheportcontrolregisterusingthe"SET[m].i"and
"CLR[m].i"instructions.Notethatwhenusingthesebitcontrolinstructions,aread-modify-write
operationtakesplace.Themicrocontrollermustrstreadinthedataontheentireport,modifyitto
therequirednewbitvaluesandthenrewritethisdatabacktotheoutputports.
PortAhastheadditionalcapabilityofprovidingwake-upfunctions.Whenthedeviceisinthe
SLEEPorIDLEMode,variousmethodsareavailabletowakethedeviceup.Oneoftheseisahigh
tolowtransitionofanyofthePortApins.SingleormultiplepinsonPortAcanbesetuptohavethis
function.
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each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either
twoorthree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,StandardandEnhancedTMsections.
Introduction
ThedevicescontainfromtwotofourTMsdependinguponwhichdeviceisselectedwitheachTM
havingareferencenameofTM0,TM1,TM2andTM3.EachindividualTMcanbecategorised
asacertaintype,namelyCompactTypeTM,StandardTypeTMorEnhancedTypeTM.Although
similarinnature,thedifferentTMtypesvaryintheirfeaturecomplexity.Thecommonfeatures
toalloftheCompact,StandardandEnhancedTMswillbedescribedinthissection,thedetailed
operationregardingeachoftheTMtypeswillbedescribedinseparatesections.Themainfeatures
anddifferencesbetweenthethreetypesofTMsaresummarisedintheaccompanyingtable.
Function CTM STM ETM
Timer/Counter
I/P Capture
Compare Match Output
PWM Channels
1 1 2
Single Pulse Output 1 2
PWM Alignment Edge Edge Edge & Centre
PWM Adjustment Period & Duty Duty or Period Duty or Period Duty or Period
TM Function Summary

Table of Contents

Related product manuals