Rev. 1.20 110 January 23, 2015 Rev. 1.20 111 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
TheI
2
CfunctioncouldbeturnedofforturnedonbycontrollingthebitIICEN.Whenthepin-
sharedI/OportsarechosentobethefunctionsotherthanSDAandSCLbyclearingtheIICENbitto
zero,theI
2
Cfunctionisturnedoffanditsoperatingcurrentwillbereducedtoaminimumvalue.In
contrary,theI
2
Cfunctionisturnedonwhenthepin-sharedI/OportsarechosentobetheSDAand
SCLpinsbysettingtheIICENbithigh.
IICC1 Register
Bit 7 6 5 4 3 2 1 0
Name IICHCF IICHAAS IICHBB IICHTX IICTXAK IICSRW IICAMWU IICRXAK
R/W R R R R/W R/W R R/W R
POR 1 0 0 0 0 0 0 1
Bit7 IICHCF:I
2
CBusdatatransfercompletionag
0:Dataisbeingtransferred
1:Completionofan8-bitdatatransfer
TheIICHCFagisthedatatransferag.Thisagwillbezerowhendataisbeing
transferred.Uponcompletionofan8-bitdatatransfertheflagwillgohighandan
interruptwillbegenerated.Belowisanexampleoftheowofatwo-byteI
2
Cdata
transfer.
First,theI
2
CslavedevicereceivesastartsignalfromtheI
2
Cmasterandthenthe
IICHCFbitisautomaticallyclearedtozero.Second,theI
2
Cslavedevicefinishes
receivingthe1stdatabyteandthentheIICHCFbitisautomaticallysettoone.Third,
usersreadthe1stdatabytefromtheIICDregisterbytheapplicationprogramandthen
theIICHCFbitisautomaticallyclearedtozero.Fourth,theI
2
Cslavedevicenishes
receivingthe2nddatabyteandthentheIICHCFbitisautomaticallysethighandso
on.Finally,theI
2
CslavedevicereceivesastopsignalfromtheI
2
Cmasterandthenthe
IICHCFbitisautomaticallysethigh.
B
it6 IICHAAS:I
2
CBusaddressmatchag
0:Notaddressmatch
1:Addressmatch
TheIICHASSagistheaddressmatchag.Thisagisusedtodetermineiftheslave
deviceaddressissameasthemastertransmitaddress.Iftheaddressesmatchthenthis
bitwillbehigh,ifthereisnomatchthentheagwillbelow.
Bit5 IICHBB:I
2
CBusbusyag
0:I
2
CBusisnotbusy
1:I
2
CBusisbusy
TheIICHBBagistheI
2
Cbusyag.Thisagwillbe"1"whentheI
2
Cbusisbusy
whichwilloccurwhenaSTARTsignalisdetected.Theagwillbesetto"0"when
thebusisfreewhichwilloccurwhenaSTOPsignalisdetected.
Bit4 IICHTX:SelectI
2
Cslavedeviceistransmitterorreceiver
0:Slavedeviceisthereceiver
1:Slavedeviceisthetransmitter
Bit3 IICTXAK:I
2
CBustransmitacknowledgeag
0:Slavesendacknowledgeag
1:Slavedonotsendacknowledgeag
TheIICTXAKbitisthetransmitacknowledgeag.Aftertheslavedevicereceiptof
8-bitsofdata,thisbitwillbetransmittedtothebusonthe9thclockfromtheslave
device.TheslavedevicemustalwayscleartheIICTXAKbittozerobeforefurther
dataisreceived.