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
Bit2 IICSRW:I
2
CSlaveRead/Writeag
0:Slavedeviceshouldbeinreceivemode
1:Slavedeviceshouldbeintransmitmode
TheIICSRWflagistheI
2
CSlaveRead/Writeflag.Thisflagdetermineswhether
themasterdevicewishestotransmitorreceivedatafromtheI
2
Cbus.Whenthe
transmittedaddressandslaveaddressismatch,thatiswhentheIICHAASagisset
high,theslavedevicewillchecktheIICSRWagtodeterminewhetheritshouldbe
intransmitmodeorreceivemode.IftheIICSRWagishigh,themasterisrequesting
toreaddatafromthebus,sotheslavedeviceshouldbeintransmitmode.Whenthe
IICSRWagiszero,themasterwillwritedatatothebus,thereforetheslavedevice
shouldbeinreceivemodetoreadthisdata.
Bit1 IICAMWU:I
2
CAddressMatchControl
0:Disable
1:Enable
Iff
SYS
comesfromf
H
andisready,thenthiscontrolbitisnoeffect,I
2
Caddressmatch
canalwaysgenerateaninterruptasthisinterruptenablebitisset.
Otherwise,settingIICAMWU=1alsocangenerateaninterruptwhenI
2
Caddress
matchasthisinterruptenablebitisset,butsettingIICAMWU=0maybecan’tgenerate
aninterruptwhenI
2
Caddressmatchevenifthisinterruptenablebitisset.
Bit0 IICRXAK:I
2
CBusReceiveacknowledgeag
0:Slavereceiveacknowledgeag
1:Slavedonotreceiveacknowledgeag
TheIICRXAKagisthereceiveracknowledgeag.WhentheIICRXAKagis"0",
itmeansthataacknowledgesignalhasbeenreceivedatthe9thclock,after8bitsof
datahavebeentransmitted.Whentheslavedeviceinthetransmitmode,theslave
devicecheckstheIICRXAKagtodetermineifthemasterreceiverwishestoreceive
thenextbyte.Theslavetransmitterwillthereforecontinuesendingoutdatauntilthe
IICRXAKagis"1".Whenthisoccurs,theslavetransmitterwillreleasetheSDAline
toallowthemastertosendaSTOPsignaltoreleasetheI
2
CBus.
I2CTOC Register
Bit 7 6 5 4 3 2 1 0
Name I2CTOEN I2CTOF
I2CTOS5 I2CTOS4 I2CTOS3 I2CTOS2 I2CTOS1 I2CTOS0
R/W R/W R/W R/W R/W R/W R/W R/W R/W
POR 0 0 0 0 0 0 0 0
Bit7 I2CTOEN:I
2
CTime-outCountrol
0:Disable
1:Enable
B
it6 IICTOF:I
2
CTime-outag
0:Notime-outoccurred
1:Time-outoccurred
Thisbitissethighwhentime-outoccursandcanonlybeclearedbyapplication
program.
B
it5~0 I2CTOS5~I2CTOS0:I
2
CTime-outperiodselection
I
2
Ctime-outclocksourceisf
SUB
/32.
I
2
Ctime-outperiodisequalto(I2CTOS[5:0]+1)×(32/f
SUB
)