HT45F23/HT45F43
8-Bit Flash MCU with Op Amps & Comparators
Interrupt Wake-up Function
Each of the interrupt functions has the capability of waking up the microcontroller when in the SLEEP
or IDLE Mode. Awake-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
SLEEPor 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 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 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 INTC0, INTC1
,MFIC0 and MFIC1 registers until the corresponding interrupt is serviced or until the request flag is
cleared by the application program.
It is recommended that programs do not use the ²CALL Subroutine² instruction within the interrupt
subroutine. Interrupts often occur in an unpredictable manner or need to be serviced immediately in
some applications. If only one stack is left and the interrupt is not well controlled, the original control
sequence will be damaged once a ²CALL subroutine² is executed in the interrupt subroutine.
All of these interrupts have the capability of waking up the processor when in the Power Down Mode.
Only the Program Counter is pushed onto the stack. If the contents of the status or other registers are
altered by the interrupt service program, which may corrupt the desired control sequence, then the
contents should be saved in advance.
Buzzer
Operating in a similar way to the Programmable Frequency Divider, the Buzzer function provides a
means of producing a variable frequency output, suitable for applications such as Piezo-buzzer driving
or other external circuits that require a precise frequency generator. The BZ and BZ pins form a
complimentary pair, and are pin-shared with I/O pins, PA6 and PA7. ABPCTLregister is used to select
from one of three buzzer options. The first option is for both pins PA6 and PA7 to be used as normal
I/Os, the second option is for both pins to be configured as BZ and BZ buzzer pins, the third option
selects only the PA6 pin to be used as a BZ buzzer pin with the PA7 pin retaining its normal I/O pin
function. Note that the BZ pin is the inverse of the BZ pin which together generate a differential output
which can supply more power to connected interfaces such as buzzers.
The buzzer is driven by the internal clock source, fTB, which then passes through a divider, the division
ratio of which is selected by BPCTL register to provide a range of buzzer frequencies from fTB/22 to
fTB/29. The clock source that generates fTB, which in turn controls the buzzer frequency, can originate
from three different sources, the LXT oscillator, the LIRC oscillator or the System oscillator/4, the
choice of which is determined by the fTB clock source option. Note that the buzzer frequency is
controlled by BPCTL register, which select the source clock for the internal clock fTB.
f
S
Y
S
L
X
T
M
U
X
B
B
Z
Z
M
U
X
(
S
e
t
b
y
B
P
C
T
L
f
T
B
R
e
g
o
s
t
e
r
)
f
T
B
C
2
9
L
I
R
C
D
i
v
i
d
~
e
2
b
y
2
C
o
n
f
i
g
u
r
a
t
i
o
n
B
T
B
C
K
i
t
O
p
t
i
o
n
B
Z
2
B
Z
1
B
Z
0
Buzzer Function
Rev. 1.20
123
September 15, 2011