XC2200 Derivatives
System Units (Vol. 1 of 2)
Interrupt and Trap Functions
User’s Manual
5-17
V2.1, 2008-08
ICU_X2K, V2.2
lists the vector locations for hardware traps and the corresponding status flags
in register TFR. It also lists the priorities of trap service for those cases in which more
than one trap condition might be detected within the same instruction. After any reset
(hardware reset, software reset instruction SRST, or reset by watchdog timer overflow)
program execution starts at the reset vector at location xx’0000
H
. Reset conditions have
priority over every other system activity and, therefore, have the highest priority (trap
priority III).
Software traps may be initiated to any defined vector location. A service routine entered
via a software TRAP instruction is always executed on the current CPU priority level
which is indicated in bitfield ILVL in register PSW. This means that routines entered via
the software TRAP instruction can be interrupted by all hardware traps or higher level
interrupt requests.
Table 5-3
Hardware Trap Summary
Exception Condition
Trap
Flag
Trap
Vector
Vector
Location
1)
1) Register VECSEG defines the segment where the vector table is located to.
Bitfield VECSC in register CPUCON1 defines the distance between two adjacent vectors. This table
represents the default setting, with a distance of 4 (two words) between two vectors.
Trap
Number
Trap
Priority
Reset Functions
–
RESET
xx’0000
H
00
H
III
Class A Hardware Traps:
•
System Request 0
•
Stack Overflow
•
Stack Underflow
•
Software Break
SR0
STKOF
STKUF
SOFTBRK
SR0TRAP
STOTRAP
STUTRAP
SBRKTRAP
xx’0008
H
xx’0010
H
xx’0018
H
xx’0020
H
02
H
04
H
06
H
08
H
II
II
II
II
Class B Hardware Traps:
•
System Request 1
•
Undefined Opcode
•
Memory Access Error
•
Protected Instruction
Fault
•
Illegal Word Operand
Access
SR1
UNDOPC
ACER
PRTFLT
ILLOPA
BTRAP
BTRAP
BTRAP
BTRAP
BTRAP
xx’0028
H
xx’0028
H
xx’0028
H
xx’0028
H
xx’0028
H
0A
H
0A
H
0A
H
0A
H
0A
H
I
I
I
I
I
Reserved
–
–
[2C
H
- 3C
H
] [0B
H
-
0F
H
]
–
Software Traps:
•
TRAP Instruction
–
–
Any
[xx’0000
H
-
xx’01FC
H
]
in steps of
4
H
Any
[00
H
-
7F
H
]
Current
CPU
Priority