
Rev. 1.10
86
March 02, 2020
Rev. 1.10
87
March 02, 2020
BS83A02L/BS83B04L
Ultra-Low Power Touch Key Flash MCU
BS83A02L/BS83B04L
Ultra-Low Power Touch Key Flash MCU
In the auto scan mode, the key oscillator and reference oscillator will automatically be enabled when
the TKST bit is set from low to high and disabled automatically when the TKBUSY bit changes
from high to low. When the TKST bit is set from low to high in the auto scan mode, the internal
capacitor value of the reference oscillator for the selected key to be scanned in the time slot 0 will
first be read from the TKM0KnROCH/TKM0KnROCL registers and loaded into the TKM0ROH/
TKM0ROL registers. Then the 16-bit C/F counter value will be written into the corresponding
location of the time slot 1 scanned key in the TKM0KnCNTH/TKM0KnCNTL registers. After
this, the selected key will start to be scanned in time slot 0. At the end of the time slot 0 key scan
operation, the reference oscillator internal capacitor value for the next selected key will be read from
the TKM0KnROCH/TKM0KnROCL registers and loaded into the next TKM0ROH/TKM0ROL
registers. Then the 16-bit C/F counter value of the current scanned key will be written into the
TKM0KnCNTH/TKM0KnCNTL registers. The whole auto scan operation will sequentially be
carried out in the above specific way from time slot 0 to time slot 1. At the end of the time slot 1 key
scan operation, the reference oscillator internal capacitor value for the time slot 0 selected key will
again be read from the TKM0K1ROCH/TKM0K1ROCL registers and loaded into the TKM0ROH/
TKM0ROL registers. Then the 16-bit C/F counter value will be written into the TKM0KnCNTH/
TKM0KnCNTL registers. After two selected keys are scanned, the TKRCOV bit will be set high
and the TKBUSY bit will be cleared to zero as well as an auto scan mode operation is completed.
Periodic Auto Scan Mode
In addition to those actions mentioned in the auto scan mode, the periodic auto scan mode
provides periodic auto scan and C/F counter upper/lower threshold comparison functions. When
the TKMOD1~TKMOD0 bits are set to 10 or 11, the periodic auto scan mode is selected to scan
the module keys automatically and periodically. Note that this mode is generally used in the IDLE
mode, in order to monitor the touch key state and minimise power consumption.
In the periodic auto scan mode, the touch key scan operation will be implemented automatically on
a periodic basis, which can be determined by the ASMP1~ASMP0 bits in the TKC2 register. The
number of touch key scan times depends upon the WDT time-out period and the periodic auto scan
mode period. Each auto scan operation will sequentially be carried out in a specific way from time
slot 0 to time slot 1 like the auto scan mode. The reference oscillator internal capacitor value for
each time slot selected key will be read from the TKM0KnROCH/TKM0KnROCL registers and
loaded into the TKM0ROH/TKM0ROL registers. However, only at the end of the last scan operation
in the WDT time-out cycle, the 16-bit C/F counter value for all scanned keys will be written into the
TKM0KnCNTH/TKM0KnCNTL registers.
In addition, each touch key has its own independent upper/lower threshold comparator. The upper/
lower threshold comparison function will automatically be enabled in the periodic auto scan mode.
When any key C/F counter value is less than the lower threshold if M0KnTHS=0, or larger than the
upper threshold if M0KnTHS=1, this indicates that the touch key state changes, then the M0KnTHF
flag will be set high by the hardware, and an interrupt signal will be generated.
As the periodic auto scan operation is implemented using the WDT counter clock to reduce power
consumption, when the WDT is cleared the WDT counter will be reset, the periodic auto scan
operation time will be affected but the number of touch key times will not be affected.