
Rev. 1.10
124
March 02, 2020
Rev. 1.10
125
March 02, 2020
BS83A02L/BS83B04L
Ultra-Low Power Touch Key Flash MCU
BS83A02L/BS83B04L
Ultra-Low Power Touch Key Flash MCU
described threshold comparison conditions occurs, a subroutine call to its interrupt vector, will
take place. When the interrupt is serviced, the Touch Key Threshold TKTH Interrupt request flag,
TKTHF, will be automatically cleared. The EMI bit will also be automatically cleared to disable
other interrupts.
For the BS83B04L, the Touch Key Threshold TKTH Interrupt is contained within the Multi-
function Interrupt. A Touch Key Threshold TKTH Interrupt request will take place when the Touch
Key Threshold TKTH Interrupt request flag, TKTHF, is set, which occurs when the Touch Key
Module 16-bit C/F counter is less than the lower threshold if M0KnTHS=0, or larger than the upper
threshold if M0KnTHS=1. To allow the program to branch to its respective interrupt vector address,
the global interrupt enable bit, EMI, Touch Key Threshold TKTH Interrupt enable bit, TKTHE, and
associated Multi-function interrupt enable bit, must first be set. When the interrupt is enabled, the
stack is not full and any of the above described threshold comparison conditions occurs, a subroutine
calls to the Multi-function Interrupt vector, will take place. When the Touch Key Threshold TKTH
Interrupt is serviced, the EMI bit will be automatically cleared to disable other interrupts, however
only the Multi-function interrupt request flag will be also automatically cleared. As the TKTHF flag
will not be automatically cleared, it has to be cleared by the application program.
TM Interrupt
The Compact Type TM each have two interrupts, one comes from the comparator A match situation
and the other comes from the comparator P match situation. All of the TM interrupts are contained
within the Multi-function Interrupts. There are two interrupt request flags and two enable control
bits. A TM interrupt request will take place when any of the TM request flags are set, a situation
which occurs when a TM comparator P or A match situation happens.
To allow the program to branch to its respective interrupt vector address, the global interrupt enable
bit, EMI, respective TM Interrupt enable bit, and relevant Multi-function Interrupt enable bit, MFnE,
must first be set. When the interrupt is enabled, the stack is not full and a TM comparator match
situation occurs, a subroutine call to the relevant Multi-function Interrupt vector locations, will take
place. When the TM interrupt is serviced, the EMI bit will be automatically cleared to disable other
interrupts, however only the related MFnF flag will be automatically cleared. As the TM interrupt
request flags will not be automatically cleared, they have to be cleared by the application program.
Interrupt Wake-up Function
Each of the interrupt functions has the capability of waking up the microcontroller when in the
SLEEP or IDLE Mode. A wake-up is generated when an interrupt request flag changes from low to
high and is independent of whether the interrupt is enabled or not. Therefore, even though the device
is in the SLEEP or IDLE Mode and its system oscillator stopped, situations such as external edge
transitions on the external interrupt pins may cause their respective interrupt flag to be set high and
consequently generate an interrupt. Care must therefore be taken if spurious wake-up situations are
to be avoided. If an interrupt wake-up function is to be disabled then the corresponding interrupt
request flag should be set high before the device enters the SLEEP or IDLE Mode. The interrupt
enable bits have no effect on the interrupt wake-up function.
Programming Considerations
By disabling the relevant interrupt enable bits, a requested interrupt can be prevented from being
serviced, however, once an interrupt request flag is set, it will remain in this condition in the
interrupt register until the corresponding interrupt is serviced or until the request flag is cleared by
the application program.
Where a certain interrupt is contained within a Multi-function interrupt, then when the interrupt