entry to the ISR. In rare cases, the I bit may be cleared inside an ISR, after clearing the
status flag that generated the interrupt, so that other interrupts can be serviced without
waiting for the first service routine to finish. This practice is recommended only for the
most experienced programmers because it can lead to subtle program errors that are
difficult to debug.
The interrupt service routine ends with a return-from-interrupt (RTI) instruction that
restores the CCR, A, X, and PC registers to their pre-interrupt values by reading the
previously saved information off the stack.
Note
For compatibility with the M68HC08, the H register is not
automatically saved and restored. Push H onto the stack at the
start of the interrupt service routine (ISR) and restore it
immediately before the RTI that is used to return from the ISR.
When two or more interrupts are pending when the I bit is cleared, the highest priority
source is serviced first.
5.1.1 Interrupt stack frame
The following figure shows the contents and organization of a stack frame. Before the
interrupt, the stack pointer (SP) points at the next available byte location on the stack.
The current values of CPU registers are stored on the stack, starting with the low-order
byte of the program counter (PC) and ending with the CCR. After stacking, the SP points
at the next available location on the stack, which is the address that is one less than the
address where the CCR was saved. The PC value that is stacked is the address of the
instruction in the main program that would have executed next if the interrupt had not
occurred.
Interrupts
MC9S08PT60 Reference Manual, Rev. 4, 08/2014
122
Freescale Semiconductor, Inc.
Содержание MC9S08PT60
Страница 2: ...MC9S08PT60 Reference Manual Rev 4 08 2014 2 Freescale Semiconductor Inc...
Страница 34: ...MC9S08PT60 Reference Manual Rev 4 08 2014 34 Freescale Semiconductor Inc...
Страница 40: ...System clock distribution MC9S08PT60 Reference Manual Rev 4 08 2014 40 Freescale Semiconductor Inc...
Страница 120: ...Flash and EEPROM registers descriptions MC9S08PT60 Reference Manual Rev 4 08 2014 120 Freescale Semiconductor Inc...
Страница 200: ...Port data registers MC9S08PT60 Reference Manual Rev 4 08 2014 200 Freescale Semiconductor Inc...
Страница 228: ...System clock gating control registers MC9S08PT60 Reference Manual Rev 4 08 2014 228 Freescale Semiconductor Inc...
Страница 262: ...Human machine interfaces HMI MC9S08PT60 Reference Manual Rev 4 08 2014 262 Freescale Semiconductor Inc...
Страница 298: ...Functional Description MC9S08PT60 Reference Manual Rev 4 08 2014 298 Freescale Semiconductor Inc...
Страница 396: ...FTM Interrupts MC9S08PT60 Reference Manual Rev 4 08 2014 396 Freescale Semiconductor Inc...
Страница 440: ...Functional description MC9S08PT60 Reference Manual Rev 4 08 2014 440 Freescale Semiconductor Inc...
Страница 468: ...Initialization Application Information MC9S08PT60 Reference Manual Rev 4 08 2014 468 Freescale Semiconductor Inc...
Страница 570: ...Application information MC9S08PT60 Reference Manual Rev 4 08 2014 570 Freescale Semiconductor Inc...
Страница 648: ...Memory map and register description MC9S08PT60 Reference Manual Rev 4 08 2014 648 Freescale Semiconductor Inc...
Страница 676: ...Resets MC9S08PT60 Reference Manual Rev 4 08 2014 676 Freescale Semiconductor Inc...