mc68hc916y3 Freescale Semiconductor, Inc, mc68hc916y3 Datasheet - Page 101

no-image

mc68hc916y3

Manufacturer Part Number
mc68hc916y3
Description
Mc68hc16y3 16 Bit Microcontroller
Manufacturer
Freescale Semiconductor, Inc
Datasheet
4.13.3 Exception Processing Sequence
4.13.4 Types of Exceptions
4.13.4.1 Asynchronous Exceptions
4.13.4.2 Synchronous Exceptions
MC68HC16Y3/916Y3
USER’S MANUAL
Exception processing is performed in four phases. Priority of all pending exceptions is
evaluated and the highest priority exception is processed first. Processor state is
stacked, then the CCR PK extension field is cleared. An exception vector number is
acquired and converted to a vector address. The content of the vector address is load-
ed into the PC and the processor jumps to the exception handler routine.
There are variations within each phase for differing types of exceptions. However, all
vectors except RESET are 16-bit addresses, and the PK field is cleared during excep-
tion processing. Consequently, exception handlers must be located within bank 0 or
vectors must point to a jump table in bank 0.
Exceptions can be either internally or externally generated. External exceptions, which
are defined as asynchronous, include interrupts, bus errors, breakpoints, and resets.
Internal exceptions, which are defined as synchronous, include the software interrupt
(SWI) instruction, the background (BGND) instruction, illegal instruction exceptions,
and the divide-by-zero exception.
Asynchronous exceptions occur without reference to CPU16 or IMB clocks, but excep-
tion processing is synchronized. For all asynchronous exceptions but RESET, excep-
tion processing begins at the first instruction boundary following recognition of an
exception. Refer to 5.8.1 Interrupt Exception Processing for more information concern-
ing asynchronous exceptions.
Because of pipelining, the stacked return PK : PC value for all asynchronous excep-
tions, other than reset, is equal to the address of the next instruction in the current in-
struction stream plus $0006. The RTI instruction, which must terminate all exception
handler routines, subtracts $0006 from the stacked value to resume execution of the
interrupted instruction stream.
Synchronous exception processing is part of an instruction definition. Exception pro-
cessing for synchronous exceptions is always completed, and the first instruction of
the handler routine is always executed, before interrupts are detected.
Because of pipelining, the value of PK : PC at the time a synchronous exception exe-
cutes is equal to the address of the instruction that causes the exception plus $0006.
Because RTI always subtracts $0006 upon return, the stacked PK : PC must be ad-
justed by the instruction that caused the exception so that execution resumes with the
following instruction. For this reason, $0002 is added to the PK : PC value before it is
stacked.
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
4-39

Related parts for mc68hc916y3