Rev. 1.10
142
November 04, 2019
Rev. 1.10
143
November 04, 2019
HT45F5Q-3
Battery Charger Flash MCU
HT45F5Q-3
Battery Charger Flash MCU
Multi-function Interrupts
Within the device there are two Multi-function interrupts. Unlike the other independent interrupts,
these interrupts have no independent source, but rather are formed from other existing interrupt
sources, namely the TM Interrupts.
A Multi-function interrupt request will take place when any of the Multi-function interrupt request
flags, MFnF are set. The Multi-function interrupt flags will be set when any of their included
functions generate an interrupt request flag. To allow the program to branch to its respective interrupt
vector address, when the Multi-function interrupt is enabled and the stack is not full, and either one
of the interrupts contained within each of Multi-function interrupt occurs, a subroutine call to one
of the Multi-function interrupt vectors will take place. When the interrupt is serviced, the related
Multi-Function request flag will be automatically reset and the EMI bit will be automatically cleared
to disable other interrupts.
However, it must be noted that, although the Multi-function Interrupt flags will be automatically
reset when the interrupt is serviced, the request flags from the original source of the Multi-function
interrupts will not be automatically reset and must be manually reset by the application program.
TM Interrupts
The Compact Type and Standard Type TMs 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, xTMPF and
xTMAF, and two enable control bits, xTMPE and xTMAE. 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.
A/D Converter Interrupt
An A/D Converter Interrupt request will take place when the A/D Converter Interrupt request flag,
ADF, is set, which occurs when the A/D conversion process finishes. To allow the program to branch
to its respective interrupt vector address, the global interrupt enable bit, EMI, and A/D Interrupt
enable bit, ADE, must first be set. When the interrupt is enabled, the stack is not full and the A/D
conversion process has ended, a subroutine call to the A/D Interrupt vector, will take place. When
the A/D Converter Interrupt is serviced, the A/D Interrupt flag, ADF, will be automatically cleared.
The EMI bit will also be automatically cleared to disable other interrupts.
USIM Interrupt
The Universal Serial Interface Module Interrupt, also known as the USIM interrupt, will take place
when the USIM Interrupt request flag, USIMF, is set. As the USIM interface can operate in three
modes which are SPI mode, I
2
C mode and UART mode, the USIMF flag can be set by different
conditions depending on the selected interface mode.
If the SPI or I
2
C mode is selected, the USIM interrupt can be triggered when a byte of data has been
received or transmitted by the USIM SPI or I
2
C interface, or an I
2
C slave address match occurs, or an
I
2
C bus time-out occurs. If the UART mode is selected, several individual UART conditions including