Rev. 1.20
1�2
�an�a�� 2�� 201�
Rev. 1.20
1��
�an�a�� 2�� 201�
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
Interrupts
Interrupts are an important part of any microcontroller system. When an external event or an
internal function such as a Touch Action or Timer/Event Counter overflow requires microcontroller
attention, their corresponding interrupt will enforce a temporary suspension of the main program
allowing the microcontroller to direct attention to their respective needs. The devices contain several
external interrupt and internal interrupt functions. The external interrupt is generated by the action of
the external INT pin and Touch Keys, while the internal interrupts are generated by various internal
functions such as Timer Modules, Time Bases, I
2
C, LVD, EEPROM and UART
.
Interrupt Registers
Overall interrupt control, which basically means the setting of request flags when certain
microcontroller conditions occur and the setting of interrupt enable bits by the application program,
is controlled by a series of registers, located in the Special Purpose Data Memory, as shown in the
accompanying table. The registers fall into two categories. The first is the INTC0~INTC
3
registers
which setup the primary interrupts, the second is the INTEG register to setup the external interrupt
trigger edge type.
Each register contains a number of enable bits to enable or disable individual registers as well as
interrupt flags to indicate the presence of an interrupt request. The naming convention of these
follows a specific pattern. First is listed an abbreviated interrupt type, then the (optional) number of
that interrupt followed by either an "E" for enable/disable bit or "F" for request flag.
Function
Enable Bit
Request Flag
Notes
Global
EMI
—
—
INT Pin
INTE
INTF
—
To�ch Ke� Mod�le
TKME
TKMF
—
I
2
C
IICE
IICF
—
UART
UARTE
UARTF
—
EEPROM
DEE
DEF
—
LVD
LVDE
LVDF
—
Time Base
TBnE
TBnF
n=0 o� 1
TM
CTMPnE
CTMPnF
n=0
PTMPnE
PTMPnF
n=0
CTMAnE
CTMAnF
n=0
PTMAnE
PTMAnF
n=0
Interrupt Register Bit Naming Conventions
Interrupt Register Contents
Name
Bit7
Bit6
Bit5
Bit4
Bit3
Bit2
Bit1
Bit0
INTEG
—
—
—
—
—
—
INTS1
INTS0
INTC0
—
TB0F
TKMF
INTF
TB0E
TKME
INTE
EMI
INTC1
PTMA0F PTMP0F CTMA0F CTMP0F PTMA0E PTMP0E CTMA0E CTMP0E
INTC2
UARTF
DEF
IICF
TB1F
UARTE
DEE
IICE
TB1E
INTC�
—
—
—
LVDF
—
—
—
LVDE