HT46801N-1 Holtek Semiconductor, HT46801N-1 Datasheet - Page 49

no-image

HT46801N-1

Manufacturer Part Number
HT46801N-1
Description
(HT4xR01x-1) Small Package 8-Bit OTP MCU
Manufacturer
Holtek Semiconductor
Datasheet
www.DataSheet.co.kr
Interrupts
Interrupts are an important part of any microcontroller
system. When an external event or an internal function
such as a Timer/Event Counter or Time Base requires
microcontroller attention, their corresponding interrupt
will enforce a temporary suspension of the main pro-
gram allowing the microcontroller to direct attention to
their respective needs.
The devices contain a single external interrupt and mul-
tiple internal interrupts. The external interrupt is con-
trolled by the action of the external interrupt pin, while
the internal interrupt is controlled by the Timer/Event
Counters and Time Base overflows.
Interrupt Register
Overall interrupt control, which means interrupt enabling
and request flag setting, is controlled by using the regis-
ters, INTC0 and INTC1. By controlling the appropriate
enable bits in the registers each individual interrupt can
be enabled or disabled. Also when an interrupt occurs,
the corresponding request flag will be set by the
microcontroller. The global enable control bit if cleared
to zero will disable all interrupts.
Interrupt Operation
A Timer/Event Counter overflow, a completion of A/D
conversion, an active edge on the external interrupt pin
or a Time Base event will all generate an interrupt re-
quest by setting their corresponding request flag. When
this happens, the Program Counter, which stores the
address of the next instruction to be executed, will be
transferred onto the stack. The Program Counter will
Rev.1.00
* A/D converter interrupt is for HT46R01B-1/HT46R01N-1 only.
Interrupt Scheme
49
then be loaded with a new address which will be the
value of the corresponding interrupt vector. The
microcontroller will then fetch its next instruction from
this interrupt vector. The instruction at this vector will
usually be a JMP statement which will jump to another
section of program which is known as the interrupt ser-
vice routine. Here is located the code to control the ap-
propriate interrupt. The interrupt service routine must be
terminated with a RETI instruction, which retrieves the
original Program Counter address from the stack and al-
lows the microcontroller to continue with normal execu-
tion at the point where the interrupt occurred.
The various interrupt enable bits, together with their as-
sociated request flags, are shown in the following dia-
gram with their order of priority.
Once an interrupt subroutine is serviced, all the other in-
terrupts will be blocked, as the EMI bit will be cleared au-
tomatically. This will prevent any further interrupt nesting
from occurring. However, if other interrupt requests oc-
cur during this interval, although the interrupt will not be
immediately serviced, the request flag will still be re-
corded. If an interrupt requires immediate servicing
while the program is already in another interrupt service
routine, the EMI bit should be set after entering the rou-
tine, to allow interrupt nesting. If the stack is full, the in-
terrupt request will not be acknowledged, even if the
related interrupt is enabled, until the Stack Pointer is
decremented. If immediate service is desired, the stack
must be prevented from becoming full.
HT46R01B-1/HT46R01N-1
HT48R01B-1/HT48R01N-1
June 9, 2011
Datasheet pdf - http://www.DataSheet4U.net/

Related parts for HT46801N-1