Rev. 1.20 116 January 23, 2015 Rev. 1.20 117 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 Time-out Control
InordertoreducetheproblemofI
2
Clockupduetoreceptionoferroneousclocksources,atime-out
functionisprovided.IftheclocksourcetotheI
2
Cisnotreceivedforawhile,thentheI
2
Ccircuitry
andregisterswillberesetafteracertaintime-outperiod.Thetime-outcounterstartscountingonan
I
2
Cbus"START"&"addressmatch"condition,andisclearedbyanSCLfallingedge.Beforethe
nextSCLfallingedgearrives,ifthetimeelapsedisgreaterthanthetime-outsetupbytheI2CTOC
register,thenatime-outconditionwilloccur.Thetime-outfunctionwillstopwhenanI
2
C"STOP"
conditionoccurs.
I C time- out
c ounte r start
I C time- out c ounte r re set
on SCL negativ e transitio n
101 001 00
1
0
01010
1
1
SCL
SDA
Stop
SCL
SDA
2
2
I
2
C Time-out
WhenanI
2
Ctime-outcounteroverowoccurs,thecounterwillstopandtheI2CTOENbitwillbe
clearedtozeroandtheI2CTOFbitwillbesethightoindicatethatatime-outconditionasoccurred.
Thetime-outconditionwillalsogenerateaninterruptwhichusestheI
2
Cinterrruptvector.When
anI
2
Ctime-outoccurs,theI
2
Cinternalcircuitrywillberesetandtheregisterswillberesetintothe
followingcondition:
Register After I
2
C Time-out
IICD, IICA, IICC0 No change
IICC1 Reset to POR condition
I
2
C Registers After Time-out
TheI2CTOFagcanbeclearedbytheapplicationprogram.Thereare64time-outperiodswhich
canbeselectedusingbitsintheI2CTOCregister.Thetime-outtimeisgivenbytheformula:
((1~64)×32)/f
SUB
Thisgivesarangeofabout1msto64ms.