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,
    1. HC12 recovers stacked registers
    2. Execution resumes at the return address
  2. If another interrupt pending
    1. HC12 recovers stacked registers
    2. Subtracts 9 from SP
    3. Sets I bit of CCR
    4. Sets X bit of CCR if an XIRQ interrupt is pending
    5. Fetches interrupt vector for the highest-priority interrupt which is pending
    6. Executes ISR at the location of the interrupt vector



Bill Rison
2001-02-26