Rev. 1.00
78
March 24, 2020
Rev. 1.00
79
March 24, 2020
BS83A04C
4-Key Enhanced Touch I/O Flash MCU
BS83A04C
4-Key Enhanced Touch I/O Flash MCU
Touch Key Interrupts
The touch key has two independent interrupts, known as touch key TKRCOV interrupt and touch
key threshold TKTH interrupt. In the manual scan mode, when the touch key module 0 time slot
counter overflows, an actual touch key TKRCOV interrupt will take place.
In the auto scan mode,
when the touch key auto scan operation is completed, the Touch Key TKRCOV Interrupt request
flag, TKRCOVF, will be set. In the periodic auto scan mode, after the last scan operation in the WDT
time-out cycle completes the 16-bit C/F counter content is written into the corresponding touch key
data memory, then the Touch Key TKRCOV Interrupt request flag, TKRCOVF, will be set. The
touch keys mentioned here are the keys which are enabled. The 16-bit C/F counter, 16-bit counter,
5-bit time slot unit period counter and 8-bit time slot counter in the module will be automatically
cleared. 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, a touch key threshold interrupt will take place. More
details regarding the touch key interrupt is located in the interrupt section of the datasheet.
Programming Considerations
After the relevant registers are setup, the touch key detection process is initiated when changing the
TKST Bit from low to high. This will enable and synchronise all relevant oscillators. The TKRCOV
flag which is the time slot counter flag will go high when the counter overflows in the manual scan
mode. When this happens an interrupt signal will be generated. In the auto scan mode, if the time
slot counter overflows but the touch key auto scan operation is not completed, the TKRCOV bit will
not be set. When the touch key auto scan operation is completed, the TKRCOV bit and the Touch
Key TKRCOV Interrupt request flag, TKRCOVF, will be set. In the periodic auto scan mode, the
TKRCOV bit is cleared to zero during the auto scan operation period. Only at the end of the last
scan operation in the WDT time-out cycle, the 16-bit C/F counter content will be written into the
corresponding touch key data memory, and then the TKRCOV bit will be set high by the hardware
circuit. The TKTH signal which is the threshold comparison indication signal will go high when
a certain threshold comparison condition occurs. When this happens an interrupt signal will also
be generated. As the TKRCOV flag will not be automatically cleared, it has to be cleared by the
application program.
The TKCFOV flag which is the 16-bit C/F counter overflow flag will go high when any of the Touch
Key Module 0 16-bit C/F counter overflows. As this flag will not be automatically cleared, it has to
be cleared by the application program.
The TK16OV flag which is the 16-bit counter overflow flag will go high when the 16-bit counter
overflows. As this flag will not be automatically cleared, it has to be cleared by the application
program.
When the external touch key size and layout are defined, their related capacitances will then
determine the sensor oscillator frequency.