AT90S/LS2333 and AT90S/LS4433
18
instruction, and it is incremented by two when an address is popped from the Stack with return from subroutine RET or
return from interrupt RETI.
Reset and Interrupt Handling
The AT90S2333/4433 provides 13 different interrupt sources. These interrupts and the separate reset vector, each have a
separate program vector in the program memory space. All interrupts are assigned individual enable bits which must be set
(one) together with the I-bit in the status register in order to enable the interrupt.
The lowest addresses in the program memory space are automatically defined as the Reset and Interrupt vectors. The
complete list of vectors is shown in Table 3. The list also determines the priority levels of the different interrupts. The lower
the address the higher is the priority level. RESET has the highest priority, and next is INT0 - the External Interrupt Request
0, etc.
The most typical program setup for the Reset and Interrupt Vector Addresses are:
Address
Labels
Code
Comments
$000
rjmp
RESET
; Reset Handler
$001
rjmp
EXT_INT0
; IRQ0 Handler
$002
rjmp
EXT_INT1
; IRQ1 Handler
$003
rjmp
TIM1_CAPT
; Timer1 Capture Handler
$004
rjmp
TIM1_COMP
; Timer1 compare Handler
$005
rjmp
TIM1_OVF
; Timer1 Overflow Handler
$006
rjmp
TIM0_OVF
; Timer0 Overflow Handler
$007
rjmp
SPI_STC;
; SPI Transfer Complete Handler
$008
rjmp
UART_RXC
; UART RX Complete Handler
$009
rjmp
UART_DRE
; UDR Empty Handler
$00a
rjmp
UART_TXC
; UART TX Complete Handler
$00b
rjmp
ADC
; ADC Conversion Complete Interrupt Handler
$00c
rjmp
EE_RDY
; EEPROM Ready Handler
$00d
rjmp
ANA_COMP
; Analog Comparator Handler
;
Table 3. Reset and Interrupt Vectors
Vector No.
Program Address
Source
Interrupt Definition
1
$000
RESET
External Pin, Power-On Reset, Brown-Out Reset and Watchdog Reset.
2
$001
INT0
External Interrupt Request 0
3
$002
INT1
External Interrupt Request 1
4
$003
TIMER1 CAPT
Timer/Counter1 Capture Event
5
$004
TIMER1 COMP
Timer/Counter1 Compare Match
6
$005
TIMER1 OVF
Timer/Counter1 Overflow
7
$006
TIMER0 OVF
Timer/Counter0 Overflow
8
$007
SPI, STC
Serial Transfer Complete
9
$008
UART, RX
UART, Rx Complete
10
$009
UART, UDRE
UART Data Register Empty
11
$00A
UART, TX
UART, Tx Complete
12
$00B
ADC
ADC Conversion Complete
13
$00C
EE_RDY
EEPROM Ready
14
$00D
ANA_COMP
Analog Comparator