Rev. 1.71 34 April 11, 2017 Rev. 1.71 35 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
EEC Register
Bit 7 6 5 4 3 2 1 0
Name — — — — WREN WR RDEN RD
R/W — — — — R/W R/W R/W R/W
POR — — — — 0 0 0 0
B
it7~4 Unimplemented,readas"0"
Bit3 WREN:DataEEPROMWriteEnable
0:Disable
1:Enable
ThisistheDataEEPROMWriteEnableBitwhichmustbesethighbeforeDataEEPROMwrite
operationsarecarriedout.ClearingthisbittozerowillinhibitDataEEPROMwriteoperations.
Bit2 WR:EEPROMWriteControl
0:Writecyclehasnished
1:Activateawritecycle
ThisistheDataEEPROMWriteControlBitandwhensethighbytheapplicationprogramwill
activateawritecycle.Thisbitwillbeautomaticallyresettozerobythehardwareafterthewrite
cyclehasnished.Settingthisbithighwill havenoeffectiftheWRENhasnotrstbeen set
high.
B
it1 RDEN:DataEEPROMReadEnable
0:Disable
1:Enable
ThisistheDataEEPROMReadEnableBitwhichmustbesethighbeforeDataEEPROMread
operationsarecarriedout.ClearingthisbittozerowillinhibitDataEEPROMreadoperations.
Bit0 RD:EEPROMReadControl
0:Readcyclehasnished
1:Activateareadcycle
ThisistheDataEEPROMReadControlBitandwhensethighbytheapplicationprogramwill
activateareadcycle.Thisbitwillbeautomaticallyresettozerobythehardwareaftertheread
cyclehasnished.SettingthisbithighwillhavenoeffectiftheRDENhasnotrstbeensethigh.
Note:TheWREN,WR,RDENandRDcannotbesetto“1”atthesametimeinoneinstruction.The
WRandRDcannotbesetto“1”atthesametime.
Reading Data from the EEPROM
ToreaddatafromtheEEPROM,thereadenablebit,RDEN,intheEECregistermustrstbeset
hightoenablethereadfunction.TheEEPROMaddressofthedatatobereadmustthenbeplaced
intheEEAregister.IftheRDbitintheEECregisterisnowsethigh,areadcyclewillbeinitiated.
SettingtheRDbithighwillnotinitiateareadoperationiftheRDENbithasnotbeenset.When
thereadcycleterminates,theRDbitwillbeautomaticallyclearedtozero,afterwhichthedatacan
bereadfromtheEEDregister.ThedatawillremainintheEEDregisteruntilanotherreadorwrite
operationisexecuted.TheapplicationprogramcanpolltheRDbittodeterminewhenthedatais
validforreading.