
User’s Manual
321
C.3 Interrupts
When enabled for User mode access, a peripheral interrupt (if it is capable of generating
an interrupt) can only be requested at Interrupt Priority Level -2 or -1. Interrupts (and
RST
s
and
SYSCALL
) all enter the System mode automatically. There will be times, however, that
an interrupt should be handled in the User mode. The solution to this is for the System
mode interrupt vector to reenter User mode before calling the User mode interrupt handler.
An example of both system and user interrupt handling is shown in Figure C-1.
Figure C-1. Interrupt Handing in System/User Mode
Some sample code for both System mode interrupts and User mode interrupts is shown
below.
system_isr: ; jumped to from interrupt vector table
... handle interrupt ...
sures ; reenter previous mode
ret
user_isr: ; jumped to from interrupt vector table
push su ; preserve current SU stack
setusr ; enter user mode
... handle interrupt ...
pop su ; restore previous SU stack
sures ; reenter previous mode
ret
INTERRUPT UNDER SYSTEM CONTROL
Application code (user)
ISR (system)
Application code (user)
INTERRUPT UNDER USER CONTROL
Application code (user)
Application ISR (user)
Application code (user)
ISR (system)
Summary of Contents for Rabbit 2000
Page 2: ...Rabbit 3000 Microprocessor User s Manual 019 0108 040731 O ...
Page 9: ...Rabbit 3000 Microprocessor ...
Page 29: ...20 Rabbit 3000 Microprocessor ...
Page 64: ...User s Manual 55 5 PIN ASSIGNMENTS AND FUNCTIONS ...
Page 79: ...70 Rabbit 3000 Microprocessor ...
Page 80: ...User s Manual 71 6 RABBIT INTERNAL I O REGISTERS ...
Page 123: ...114 Rabbit 3000 Microprocessor ...
Page 137: ...128 Rabbit 3000 Microprocessor ...
Page 157: ...148 Rabbit 3000 Microprocessor ...
Page 207: ...198 Rabbit 3000 Microprocessor ...
Page 249: ...240 Rabbit 3000 Microprocessor ...
Page 255: ...246 Rabbit 3000 Microprocessor ...
Page 277: ...268 Rabbit 3000 Microprocessor ...
Page 343: ...334 Rabbit 3000 Microprocessor ...
Page 345: ......