Rev. 1.20 104 January 23, 2015 Rev. 1.20 105 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
Touch Key Operation
Whenangertouchesorisinproximitytoatouchpad,thecapacitanceofthepadwillincrease.
Byusingthiscapacitancevariationtochangeslightlythefrequencyoftheinternalsenseoscillator,
touchactionscanbesensedbymeasuringthesefrequencychanges.Usinganinternalprogrammable
dividerthereferenceclockisusedtogenerateafixedtimeperiod.Bycountinganumberof
generatedclockcyclesfromthesenseoscillatorduringthisxedtimeperiodtouchkeyactionscan
bedetermined.
EachtouchkeymodulecontainsfourtouchkeyinputswhicharesharedlogicalI/Opins,and
thedesiredfunctionisselectedusingregisterbits.Eachtouchkeyhasitsownindependentsense
oscillator.Therearethereforefoursenseoscillatorswithineachtouchkeymodule.
Duringthisreferenceclockfixedinterval,thenumberofclockcyclesgeneratedbythesense
oscillatorismeasured,anditisthisvaluethatisusedtodetermineifatouchactionhasbeenmade
ornot.AttheendofthexedreferenceclocktimeintervalaTouchKeyinterruptsignalwillbe
generated.
UsingtheTSCSbitintheTKC0registercanselectthemodule0timeslotcounterasthetimeslot
counterforallmodules.Allmodulesusethesamestartedsignal.The16-bitC/Fcounter,16-bit
counter,5-bittimeslotcounterinallmoduleswillbeautomaticallyclearedwhenthisbitiscleared
tozero,butthe8-bitprogrammabletimeslotcounterwillnotbecleared.Theoverowtimeissetup
byuser.Whenthisbitchangesfromlowtohigh,the16-bitC/Fcounter,16-bitcounter,5-bittime
slotcounterand8-bittimeslottimercounterwillbeautomaticallyswitchedon.
Thekeyoscillatorandreferenceoscillatorinallmoduleswillbeautomaticallystoppedandthe
16-bitC/Fcounter,16-bitcounter,5-bittimeslotcounterand8-bittimeslottimercounterwillbe
automaticallyswitchedoffwhenthe5-bittimeslotcounteroverows.Theclocksourceforthetime
slotcounterand8+5bitcounter,issourcedfromthereferenceoscillatororf
SYS
/4.Thereference
oscillatorandkeyoscillatorwillbeenabledbysettingtheMnROENbitandMnKOENbitsinthe
TKMnC1register.
Whenthetimeslotcounterinallthetouchkeymodulesorinthetouchkeymodule0overows,
anactualtouchkeyinterruptwilltakeplace.Thetouchkeysmentionedherearethekeyswhichare
enabled.
Eachtouchkeymoduleconsistsoffourtouchkeys,Key1~Key4arecontainedinmodule0,Key5
~Key8arecontainedinmodule1,Key9~Key12arecontainedinmodule2,Key13~Key16are
containedinthemodule3andKey17~Key20arecontainedinthemodule4.Eachtouchkey
modulehasanidenticalstructure.