User`s guide
Rev. 1.10 68 November 14, 2014 Rev. 1.10 69 November 14, 2014
HT66FW2230
Wireless Charger A/D Flash 8-Bit MCU
Timer/Counter Mode
Toselectthismode,bitsT1M1andT1M0intheTM1C1registershouldbesetto11respectively.
TheTimer/CounterModeoperatesinanidenticalwaytotheCompareMatchOutputMode
generatingthesameinterruptags.TheexceptionisthatintheTimer/CounterModetheTMoutput
pinisnotused.ThereforetheabovedescriptionandTimingDiagramsfortheCompareMatch
OutputModecanbeusedtounderstanditsfunction.AstheTMoutputpinisnotusedinthismode,
thepincanbeusedasanormalI/Opinorotherpin-sharedfunction.
PWM Output Mode
Toselectthismode,bitsT1M1andT1M0intheTM1C1registershouldbesetto10respectively.
ThePWMfunctionwithintheTMisusefulforapplicationswhichrequirefunctionssuchasmotor
control,heatingcontrol,illuminationcontroletc.Byprovidingasignaloffixedfrequencybut
ofvaryingdutycycleontheTMoutputpin,asquarewaveACwaveformcanbegeneratedwith
varyingequivalentDCRMSvalues.
AsboththeperiodanddutycycleofthePWMwaveformcanbecontrolled,thechoiceofgenerated
waveformisextremelyflexible.InthePWMmode,theT1CCLRbithasnoeffectonthePWM
operation.BothoftheCCRAandCCRPregistersareusedtogeneratethePWMwaveform,one
registerisusedtocleartheinternalcounterandthuscontrolthePWMwaveformfrequency,while
theotheroneisusedtocontrolthedutycycle.Whichregisterisusedtocontroleitherfrequency
ordutycycleisdeterminedusingtheT1DPXbitintheTM1C1register.ThePWMwaveform
frequencyanddutycyclecanthereforebecontrolledbythevaluesintheCCRAandCCRPregisters.
Aninterruptag,oneforeachoftheCCRAandCCRP,willbegeneratedwhenacomparematch
occursfromeitherComparatorAorComparatorP.TheT1OCbitintheTM1C1registerisusedto
selecttherequiredpolarityofthePWMwaveformwhilethetwoT1IO1andT1IO0bitsareusedto
enablethePWMoutputortoforcetheTMoutputpintoaxedhighorlowlevel.TheT1POLbitis
usedtoreversethepolarityofthePWMoutputwaveform.
10-bit CTM, PWM Mode, Edge-aligned Mode, T1DPX=0
CCRP 001b 010b 011b 100b 101b 110b 111b 000b
Period 128 256 384 512 640 768 896 1024
Duty CCRA
Iff
SYS
=16MHz,TMclocksourceisf
SYS
/4,CCRP=100bandCCRA=128,
TheCTMPWMoutputfrequency=(f
SYS
/4)/512=f
SYS
/2048=7.8125kHz,duty=128/512=25%.
IftheDutyvaluedenedbytheCCRAregisterisequaltoorgreaterthanthePeriodvalue,thenthe
PWMoutputdutyis100%.
10-bit CTM, PWM Mode, Edge-aligned Mode, T1DPX=1
CCRP 001b 010b 011b 100b 101b 110b 111b 000b
Period CCRA
Duty
128 256 384 512 640 768 896 1024
ThePWMoutputperiodisdeterminedbytheCCRAregistervaluetogetherwiththeTMclock
whilethePWMdutycycleisdenedbytheCCRPregistervalue.