Rev. 1.00
1�6
��ne ��� �01�
Rev. 1.00
1��
��ne ��� �01�
HT66FM5440
Brushless DC Motor A/D Flash MCU
HT66FM5440
Brushless DC Motor A/D Flash MCU
A/D Converter Interrupts
The A/D Converter has three interrupts. One is the A/D converter boundary interrupt which is
controlled by the comparison between the converted data registers, ADRH/ADRL or ISRHn/
ISRLn, and the boundary register pairs, ADHVDH/ADHVDL and ADLVDH/ADLVDL. It has its
independent interrupt number. The other two are the A/D normal conversion interrupt, which is
controlled by the end of an normal A/D conversion process, and the A/D auto-scan interrupt, which
is controlled by the end of A/D auto-scan process. They are contained within the multi-function 2
and share the same interrupt number.
After being configured with the desired interrupt priority level, the A/D converter boundary interrupt
request will take place when the related interrupt priority request flag is set, which occurs when the
preset comparison type defined in the ADCHVE and ADCLVE bits in the ADCR1 register takes
place. To allow the program to branch to its interrupt bector address, the global interrupt enable bit,
EMI, and the related interrupt priority enable bit must first be set. When the interrupt is enabled, the
stack is not full and the preset A/D comparise type occurs, a subroutine call to its interrupt vector
will take place. When the A/D converter boundary interrupt is serviced, the related interrupt priority
request flag will be automatically reset and the EMI bit will be automatically cleared to disable other
interrupts.
After being configured with the desired interrupt priority level, an A/D normal conversion
i
nterrupt
request or A/D auto-scan interrupt request will take place when the A/D normal conversion
i
nterrupt
request flag, AEOCF, or the A/D auto-scan interrupt request flag, ISAEOCF, and the corresponding
interrupt priority request flag are set, which occurs when the A/D normal conversion process or
the A/D auto-scan process finishes. To allow the program to branch to the respective interrupt
vector address, the global interrupt enable bit, EMI, the A/D normal conversion interrupt enable
bit, AEOCE, or the A/D auto-scan interrupt enable bit, ISAEOCE, and associated interrupt priority
enable bit, must first be set. When the interrupt is enabled, the stack is not full and the A/D normal
conversion process or auto-scan process has ended, a subroutine call to the
i
nterrupt vector will
take place. When the
i
nterrupt is serviced, the EMI bit will be automatically cleared to disable
other interrupts, however only the relevant interrupt priority request flag will be also automatically
cleared. As the AEOCF flag and ISAEICF flag will not be automatically cleared, they have to be
cleared by the application program.
TM Interrupts
The Periodic Type TMs each 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
i
nterrupts and share the same interrupt number with other interrupts in
the same group. For all of the TM types there are two interrupt request flags, TMnPF and TMnAF,
and two enable control
bits
, TMnPE and TMnAE. After being configured with the desired interrupt
priority level, a TM interrupt request will take place when any of the TM request flags together with
the associated interrupt priority request flag 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
i
nterrupt priority enable bit 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
i
nterrupt 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 interrupt priority 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.