Rev. 2.50 184 June 22, 2017 Rev. 2.50 185 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
Bit3 C1OS:Outputpathselect
0:C1Xpin
1:Internaluse
Thisisthecomparatoroutputpathselectcontrolbit.Ifthebitissetto"0"andthe
C1SELbitis"1"thecomparatoroutputisconnectedtoanexternalC1Xpin.Ifthe
bitissetto"1"ortheC1SELbitis"0"thecomparatoroutputsignalisonlyused
internallybythedeviceallowingthesharedcomparatoroutputpintoretainitsnormal
I/Ooperation.
Bit2~1 Unimplemented,readas“0”
Bit0 C1HYEN:HysteresisControl
0:Off
1:On
Thisisthehysteresiscontrolbitandifsethighwillapplyalimitedamountof
hysteresistothecomparator,asspeciedintheComparatorElectricalCharacteristics
table.Thepositivefeedbackinducedbyhysteresisreducestheeffectofspurious
switchingnearthecomparatorthreshold.
Comparator Interrupt
Eachalsopossessesitsowninterruptfunction.Whenanyoneoftheoutputbitchangesstate,its
relevantinterruptagwillbeset,andifthecorrespondinginterruptenablebitisset,thenajump
toitsrelevantinterruptvectorwillbeexecuted.NotethatitisthechangingstateoftheC0OUT
orC1OUTbitandnottheoutputpinwhichgeneratesaninterrupt.Ifthemicrocontrollerisinthe
SLEEPorIDLEModeandtheComparatorisenabled,theniftheexternalinputlinescausethe
Comparatoroutputtochangestate,theresultinggeneratedinterruptagwillalsogenerateawake-
up.Ifitisrequiredtodisableawake-upfromoccurring,thentheinterruptagshouldberstset
highbeforeenteringtheSLEEPorIDLEMode.
Programming Considerations
Ifthecomparatorisenabled,itwillremainactivewhenthemicrocontrollerenterstheSLEEPor
IDLEMode,howeverasitwillconsumeacertainamountofpower,theusermaywishtoconsider
disablingitbeforetheSLEEPorIDLEModeisentered.
AscomparatorpinsaresharedwithnormalI/OpinstheI/Oregistersforthesepinswillbereadas
zero(portcontrolregisteris"1")orreadasportdataregistervalue(portcontrolregisteris"0")ifthe
comparatorfunctionisenabled.