Rev. 1.20 108 January 23, 2015 Rev. 1.20 109 January 23, 2015
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
BS82B12A-3/BS82C16A-3/BS82D20A-3
Touch Key 8-Bit Flash MCU with LED/LCD Driver
I
2
C Interface
TheI
2
Cinterfaceisusedtocommunicatewithexternalperipheraldevicessuchassensors,
EEPROMmemoryetc.OriginallydevelopedbyPhilips,itisatwolinelowspeedserialinterface
forsynchronousserialdatatransfer.Theadvantageofonlytwolinesforcommunication,relatively
simplecommunicationprotocolandtheabilitytoaccommodatemultipledevicesonthesamebus
hasmadeitanextremelypopularinterfacetypeformanyapplications.
I
2
C Master/Slave Bus Connection
I
2
C Block Diagram
I
2
C Interface Operation
TheI
2
Cserialinterfaceisatwolineinterface,aserialdataline,SDA,andserialclockline,SCL.As
manydevicesmaybeconnectedtogetheronthesamebus,theiroutputsarebothopendraintypes.
Forthisreasonitisnecessarythatexternalpull-highresistorsareconnectedtotheseoutputs.Note
thatnochipselectlineexists,aseachdeviceontheI
2
Cbusisidentiedbyauniqueaddresswhich
willbetransmittedandreceivedontheI
2
Cbus.
WhentwodevicescommunicatewitheachotheronthebidirectionalI
2
Cbus,oneisknownasthe
masterdeviceandoneastheslavedevice.Bothmasterandslavecantransmitandreceivedata,
however,itisthemasterdevicethathasoverallcontrolofthebus.Forthesedevices,whichonly
operateinslavemode,therearetwomethodsoftransferringdataontheI
2
Cbus,theslavetransmit
modeandtheslavereceivemode.
ItissuggestedthattheusershallnotenterthemicroprocessortoHALTstatusbyapplication
programduringprocessingI
2
Ccommunication.
IfthepinisconguredtoSDAorSCLfunctionofI
2
Cinterface,thepinisconguredtoopen-collect
Input/OutputportanditsPull-highfunctioncanbeenabledbyprogrammingtherelatedGeneric
Pull-highControlRegister.