What happens when an HC12 gets in unmasked interrupt:

1.
Completes current instruction
2.
Clears instruction queue
3.
Calculates return address
4.
Stacks return address and contents of CPU registers
5.
Sets I bit of CCR
6.
Sets X bit of CCR if an XIRQ interrupt is pending
7.
Fetches interrupt vector for the highest-priority interrupt which is pending
8.
Executes ISR at the location of the interrupt vector

What happens when an HC12 exits an ISR with the RTI instruction:

1.
If no other interrupt pending,
(a)
HC12 recovers stacked registers
(b)
Execution resumes at the return address
2.
If another interrupt pending
(a)
HC12 recovers stacked registers
(b)
Subtracts 9 from SP
(c)
Sets I bit of CCR
(d)
Sets X bit of CCR if an XIRQ interrupt is pending
(e)
Fetches interrupt vector for the highest-priority interrupt which is pending
(f)
Executes ISR at the location of the interrupt vector



Bill Rison
2000-02-23