Download Print this page

Atmel AVR AT90S2323 Manual page 19

8-bit microcontroller with 2k bytes of in-system programmable flash

Advertisement

Stack Pointer – SPL
Reset and Interrupt
Handling
1004D–09/01
• Bit 0 – C: Carry Flag
The carry flag C indicates a carry in an arithmetical or logical operation. See the Instruc-
tion Set description for detailed information.
Note that the Status Register is not automatically stored when entering an interrupt rou-
tine and restored when returning from an interrupt routine. This must be handled by
software.
An 8- bit r egister at I/O addres s $3D ( $5D) for ms the stack pointer of the
AT90S2323/2343. Eight bits are used to address the 128 bytes of SRAM in locations
$60 - $DF.
Bit
7
$3D ($5D)
SP7
SP6
Read/Write
R/W
R/W
Initial Value
0
The Stack Pointer points to the data SRAM stack area where the Subroutine and Inter-
rupt stacks are located. This stack space in the data SRAM must be defined by the
program before any subroutine calls are executed or interrupts are enabled. The Stack
Pointer must be set to point above $60. The Stack Pointer is decremented by 1 when
data is pushed onto the Stack with the PUSH instruction and it is decremented by 2
when an address is pushed onto the stack with subroutine calls and interrupts. The
Stack Pointer is incremented by 1 when data is popped from the stack with the POP
instruction and it is incremented by 2 when an address is popped from the stack with
return from subroutine RET or return from interrupt RETI.
The AT90S2323/2343 provides two interrupt sources. These interrupts and the separate
reset vector each have a separate program vector in the program memory space. Both
interrupts are assigned individual enable bits that 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 interrupts. The lower the address, the higher
the priority level. RESET has the highest priority, and next is INT0 (the External Interrupt
Request 0), etc.
Table 3. Reset and Interrupt Vectors
Vector No.
Program Address
1
$000
2
$001
3
$002
6
5
4
SP5
SP4
SP3
R/W
R/W
R/W
0
0
0
Source
RESET
INT0
TIMER0, OVF0
AT90S/LS2323/2343
3
2
1
SP2
SP1
R/W
R/W
0
0
0
Interrupt Definition
Hardware Pin, Power-on Reset and
Watchdog Reset
External Interrupt Request 0
Timer/Counter0 Overflow
0
SP0
SPL
R/W
0
19

Advertisement

loading

This manual is also suitable for:

Avr at90ls2323Avr at90ls2343Avr at90ss2343At90s2323At90ls2323At90s2343 ... Show all