Rev. 1.10
102
November 26, 2019
Rev. 1.10
103
November 26, 2019
HT68FB240
USB Low Speed Flash MCU
External Interrupt
The external interrupt is controlled by signal transitions on the INTn pins. An external interrupt
request will take place when the external interrupt request flag, INTnF, is set, which will occur
when a transition, whose type is chosen by the edge select bits, appears on the external interrupt
pin. To allow the program to branch to its respective interrupt vector address, the global interrupt
enable bit, EMI, and respective external interrupt enable bit, INTnE, must first be set. Additionally
the correct interrupt edge type must be selected using the related register to enable the external
interrupt function and to choose the trigger edge type. As the external interrupt pin is pin-shared
with I/O pin, it can only be configured as external interrupt pin if the external interrupt enable bit in
the corresponding interrupt register has been set. The pin must also be setup as an input by setting
the corresponding bit in the port control register. When the interrupt is enabled, the stack is not full
and the correct transition type appears on the external interrupt pin, a subroutine call to the external
interrupt vector, will take place. When the interrupt is serviced, the external interrupt request flag,
INTnF, will be automatically reset and the EMI bit will be automatically cleared to disable other
interrupts. Note that any pull-high resistor selections on the external interrupt pin will remain valid
even if the pin is used as an external interrupt input.
The INTEG register is used to select the type of active edge that will trigger the external interrupt.
A choice of either rising or falling or both edge types can be chosen to trigger an external interrupt.
Note that the INTEG register can also be used to disable the external interrupt function.
USB SIE Interrupt
A USB
SIE interrupt request will take place when the USB SIE interrupt request flags, USBF, is set,
a situation that will occur when an endpoint except endpoint 0 is accessed. To allow the program to
branch to its respective interrupt vector address, the global interrupt enable bit, EMI, and USB SIE
interrupt enable bit, USBE, must first be set. When the interrupt is enabled, the stack is not full and
an endpoint is accessed, a subroutine call to the USB SIE interrupt vector, will take place. When the
interrupt is serviced, the USB SIE interrupt request flag, USBF, will be automatically reset and the
EMI bit will be automatically cleared to disable other interrupts.
USB Setup Token Interrupt
A USB Setup Token interrupt request will take place when the USB Setup Token interrupt request
flags, US
T
F, is set, a situation that will occur when the USB receives
endpoint 0
Setup token signal
from PC. To allow the program to branch to its respective interrupt vector address, the global
interrupt enable bit, EMI, and USB Setup Token interrupt enable bit, US
T
E, must first be set. When
the interrupt is enabled, the stack is not full and an endpoint is accessed, a subroutine call to the
USB Setup Token interrupt vector, will take place. When the interrupt is serviced, the USB Setup
Token interrupt request flag, US
T
F, will be automatically reset and the EMI bit will be automatically
cleared to disable other interrupts.
USB Endpoint 0 IN Token Interrupt
A USB Endpoint 0 IN Token interrupt request will take place when the USB Endpoint 0 IN Token
interrupt request flags, U
IT
F, is set, a situation that will occur when the USB receives
endpoint 0
IN
token signal from PC. To allow the program to branch to its respective interrupt vector address, the
global interrupt enable bit, EMI, and USB Endpoint 0 IN Token interrupt enable bit, U
IT
E, must first
be set. When the interrupt is enabled, the stack is not full and an endpoint is accessed, a subroutine
call to the USB Endpoint 0 IN Token interrupt vector, will take place. When the interrupt is serviced,
the USB Endpoint 0 IN Token interrupt request flag, U
IT
F, will be automatically reset and the EMI
bit will be automatically cleared to disable other interrupts.