What happens when an HC12 gets in unmasked interrupt:
- Completes current instruction
- Clears instruction queue
- Calculates return address
- Stacks return address and contents of CPU registers
- Sets I bit of CCR
- Sets X bit of CCR if an XIRQ interrupt is pending
- Fetches interrupt vector for the highest-priority interrupt which is
pending
- Executes ISR at the location of the interrupt vector
What happens when an HC12 exits an ISR with the RTI instruction:
- If no other interrupt pending,
- HC12 recovers stacked registers
- Execution resumes at the return address
- If another interrupt pending
- HC12 recovers stacked registers
- Subtracts 9 from SP
- Sets I bit of CCR
- Sets X bit of CCR if an XIRQ interrupt is pending
- Fetches interrupt vector for the highest-priority interrupt which is
pending
- Executes ISR at the location of the interrupt vector
Bill Rison
2001-02-26