Rev. 1.71 64 April 11, 2017 Rev. 1.71 65 April 11, 2017
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
HT66F002/HT66F0025/HT66F003/HT66F004
Cost-Effective A/D Flash MCU with EEPROM
System Clock output pin CLO
ThedeviceHT66F004providesasystemclockoutputpinCLO.MCUsystemclockcanoutputto
theCLOpinbysettingpin-sharedcontrolregisterbitPBS4to1.Thehighestoutputfrequencyis
8MHzinthisdevice.Pleasenotethatwhenthenoiseproblemisanimportantissue,itisbetternotto
useCLOoutputfunction.
Programming Considerations
Withintheuserprogram,oneoftherstthingstoconsiderisportinitialisation.Afterareset,all
oftheI/Odataandportcontrolregisterswillbesethigh.ThismeansthatallI/Opinswilldefault
toaninputstate,thelevelofwhichdependsontheotherconnectedcircuitryandwhetherpull-
highselectionshavebeenchosen.Iftheportcontrolregistersarethenprogrammedtosetupsome
pinsasoutputs,theseoutputpinswillhaveaninitialhighoutputvalueunlesstheassociatedport
dataregistersarerstprogrammed.Selectingwhichpinsareinputsandwhichareoutputscanbe
achievedbyte-widebyloadingthecorrectvaluesintotheappropriateportcontrolregisterorby
programmingindividualbitsintheportcontrolregisterusingthe“SET[m].i”and“CLR[m].i”
instructions.Notethatwhenusingthesebitcontrolinstructions,aread-modify-writeoperationtakes
place.Themicrocontrollermustrstreadinthedataontheentireport,modifyittotherequirednew
bitvaluesandthenrewritethisdatabacktotheoutputports.
PortAhastheadditionalcapabilityofprovidingwake-upfunctions.Whenthedeviceisinthe
SLEEPorIDLEMode,variousmethodsareavailabletowakethedeviceup.Oneoftheseisahigh
tolowtransitionofanyofthePortApins.SingleormultiplepinsonPortAcanbesetuptohavethis
function.