
Rev. 1.40
130
March 29, 2019
Rev. 1.40
131
March 29, 2019
HT45F23A/HT45F24A
TinyPower
TM
Flash MCU with OPA & Comparators
HT45F23A/HT45F24A
TinyPower
TM
Flash MCU with OPA & Comparators
Comparator Interrupt
The Comparator Interrupt is contained within the Multi-function Interrupt.
The comparator interrupt is controlled by the two internal comparators. A comparator interrupt
request will take place when the comparator interrupt request flag, CF, is set, a situation that will
occur when the comparator output changes state. To allow the program to branch to its respective
interrupt vector address, the global interrupt enable bit, EMI, Multi-function interrupt enable bit,
EMFI and comparator interrupt enable bit, ECI, must first be set. When the interrupt is enabled, the
stack is not full and the comparator input generates a comparator output transition, a subroutine call
to the comparator interrupt vector, will take place. When the Comparator 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 CF flag will not be automatically
cleared, it has to be cleared by the application program.
EEPROM Interrupt
The EEPROM Interrupt is contained within the Multi-function Interrupt. An EEPROM Interrupt
request will take place when the EEPROM Interrupt request flag, E2F, is set, which occurs when an
EEPROM Write or Read cycle ends. To allow the program to branch to its respective interrupt vector
address, the global interrupt enable bit, EMI, EEPROM Interrupt enable bit, EE2I, and associated
Multi-function interrupt enable bit, EMFI, must first be set. When the interrupt is enabled, the stack
is not full and an EEPROM Write or Read cycle ends, a subroutine call to the respective Multi-
function Interrupt vector, will take place. When the EEPROM 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 E2F flag will not be automatically cleared, it
has to be cleared by the application program.
LVD Interrupt
The Low Voltage Detector Interrupt is contained within the Multi-function Interrupt. An LVD
Interrupt request will take place when the LVD Interrupt request flag, LVDF, is set, which occurs
when the Low Voltage Detector function detects a low power supply voltage. To allow the program
to branch to its respective interrupt vector address, the global interrupt enable bit, EMI, Low Voltage
Interrupt enable bit, ELVDI, and associated Multi-function interrupt enable bit, EMFI, must first
be set. When the interrupt is enabled, the stack is not full and a low voltage condition occurs,
a subroutine call to the Multi-function Interrupt vector, will take place. When the Low Voltage
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 LVDF flag
will not be automatically cleared, it has 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
devices are in the SLEEP or IDLE Mode and its system oscillator stopped, situations such as
external edge transitions on the external interrupt pins, a low power supply voltage or comparator
input change 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 devices enter the SLEEP or IDLE Mode. The interrupt enable bits have no effect
on the interrupt wake-up function.