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
Multi-function Interrupts
Within the device there are up to seven 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 Hall sensor input interrupts, PWM period and duty interrupts, TM
Interrupts, A/D Converter Interrupts, UART Interrupt, I
2
C interrupt and LVD Interrupt.
The interrupt sources within each Multi-function interrupt share the same interrupt number. After
being configured with the desired interrupt priority level, a multi-function request will take place
when its relevant interrupt priority request flag, Int_prin
F
,
is
set, which occurs when any of
its
included functions generate an interrupt request. To allow the program to branch to its respective
interrupt vector address, the global interrupt enable bit, EMI, and the relevant interrupt priority
enable bit, must first be set. When the 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
interrupt priority 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 interrupt priority request flag
s
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.
PWM Module Interrupts
T
he PWM module has five interrupts, one PWM Period match interrupt known as PWMP and four
PWM Duty match interrupts known as PWMDn (n=0~3). The PWMP and PWMD0~PWMD2
interrupts are contained in multi-function interrupt 1 and they share the same interrupt number. The
PWMD3 interrupt has its independent number.
Regarding the PWMP and PWMD0~PWMD2 interrupts, after being configured with the desired
interrupt priority level, a PWM interrupt request will take place when the PWM interrupt request
flag, PWMPF or PWMDnF, and the corresponding interrupt priority request flag, are set, which
occurs when the PWM Period or Duty matches. To allow the program to branch to its respectively
interrupt vector address, the global intgerrupt enable bit, EMI, the PWM Period or Duty match
interrupt enable bit, PWMPE or PWMDnE, and the relevant interrupt priority enable bit, must first
be set. When the interrupt is enabled, the stack is not full and the PWM Period or Duty maches, a
subroutine call to this vector loacation will take place. When the interrupt is serviced, the EMI bit
will be automatically cleared to disable other interrupts and the interrupt priority request flag will be
automatically reset, but the interrupt request flag, PWMDnF or PWMPF, must be manually cleared
by the application program.
Regarding the PWMD3 interrupt, after being configured with the desired interrupt priority level,
its interrupt request will take place when the associated interrupt priority request flag, Int_prinF, is
set, which occurs when the PWM Duty 3 maches. To allow the program to branch to its interrupt
vector address, the global intgerrupt enable bit, EMI, and the relevant interrupt priority enable bit
must first be set. When the interrupt is enabled, the stack is not full and the PWM Duty 3 maches,
a subroutine call to this vector loacation will take place. When the interrupt is serviced, the EMI bit
will be automatically cleared to disable other interrupts and the interrupt priority request flag will be
automatically reset.