Rev. 2.50 196 June 22, 2017 Rev. 2.50 197 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
I
2
C Block Diagram
I
2
C Bus Communication
CommunicationontheI
2
Cbusrequiresfourseparatesteps,aSTARTsignal,aslavedeviceaddress
transmission,adatatransmissionandfinallyaSTOPsignal.WhenaSTARTsignalisplacedon
theI
2
Cbus,alldevicesonthebuswillreceivethissignalandbenotiedoftheimminentarrivalof
dataonthebus.Therstsevenbitsofthedatawillbetheslaveaddresswiththerstbitbeingthe
MSB.Iftheaddressoftheslavedevicematchesthatofthetransmittedaddress,theHAASbitinthe
SIMC1registerwillbesetandanI
2
Cinterruptwillbegenerated.Afterenteringtheinterruptservice
routine,theslavedevicemustrstchecktheconditionoftheHAASbittodeterminewhetherthe
interruptsourceoriginatesfromanaddressmatchorfromthecompletionofan8-bitdatatransfer.
Duringadatatransfer,notethatafterthe7-bitslaveaddresshasbeentransmitted,thefollowingbit,
whichisthe8thbit,istheread/writebitwhosevaluewillbeplacedintheSRWbit.Thisbitwillbe
checkedbytheslavedevicetodeterminewhethertogointotransmitorreceivemode.Beforeany
transferofdatatoorfromtheI
2
Cbus,themicrocontrollermustinitialisethebus,thefollowingare
stepstoachievethis:
• Step1
SettheSIM2~SIM0bitsandSIMENbitintheSIMC0registerto"110"and"1"respectivelyto
enabletheI
2
Cbus.
• Step2
WritetheslaveaddressofthedevicetotheI
2
CbusaddressregisterSIMA.
• Step3
SettheSIMEandSIMMuti-Functioninterruptenablebitoftheinterruptcontrolregisterto
enabletheSIMinterruptandMulti-functioninterrupt.