Rev. 1.10
136
November 04, 2019
Rev. 1.10
137
November 04, 2019
HT45F5Q-3
Battery Charger Flash MCU
HT45F5Q-3
Battery Charger Flash MCU
Interrupts
Interrupts are an important part of any microcontroller system. When an external event or an
internal function such as a Timer Module or an A/D converter 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 device contains several external
interrupt and internal interrupt functions. The external interrupt is generated by the action of the
external INT0~INT1 pins, while the internal interrupts are generated by various internal functions
such as the TMs, Time Bases, USIM and the A/D converter, etc.
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 number of registers falls into three categories. The first is the
INTC0~INTC2 registers which setup the primary interrupts, the second is the MFI0~MFI1 register
which setups the Multi-function interrupts. Finally there is an 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
—
—
INTn Pin
INTnE
INTnF
n=0~1
Time Base
TBnE
TBnF
n=0~1
Multi-function
MFnE
MFnF
n=0~1
A/D Converter
ADE
ADF
—
USIM
USIME
USIMF
—
CTM
CTMPE
CTMPF
—
CTMAE
CTMAF
—
STM
STMPE
STMPF
—
STMAE
STMAF
—
Interrupt Register Bit Naming Conventions
Register
Name
Bit
7
6
5
4
3
2
1
0
INTEG
—
—
—
—
INT1S1
INT1S0
INT0S1
INT0S0
INTC0
—
TB0F
INT1F
INT0F
TB0E
INT1E
INT0E
EMI
INTC1
ADF
MF1F
MF0F
TB1F
ADE
MF1E
MF0E
TB1E
INTC2
—
—
—
USIMF
—
—
—
USIME
MFI0
—
—
CTMAF
CTMPF
—
—
CTMAE
CTMPE
MFI1
—
—
STMAF
STMPF
—
—
STMAE
STMPE
Interrupt Register List