Philips LPC213 Series User Manual page 250

Table of Contents

Advertisement

Philips Semiconductors
Volume 1
Reset_Address
Undefined_Address
SWI_Address
Prefetch_Address
Abort_Address
FIQ_Address
AREA init_code, CODE
ram_end EQU 0x4000xxxx ; Top of on-chip RAM.
__init
; /*********************************************************************
; * Set up the stack pointers for various processor modes. Stack grows
; * downwards.
; *********************************************************************/
; /*********************************************************************
User manual
LDR pc, [pc, #-0xFF0] ;Load IRQ vector from VIC
LDR PC, FIQ_Address
DCD __init
DCD rm_undef_handler ;Provided by RealMonitor
DCD 0
DCD rm_prefetchabort_handler
DCD rm_dataabort_handler
DCD 0
LDR
r2, =ram_end ;Get top of RAM
MRS r0, CPSR ;Save current processor mode
; Initialize the Undef mode stack for RealMonitor use
BIC
r1, r0, #0x1f
ORR
r1, r1, #0x1b
MSR
CPSR_c, r1
;Keep top 32 bytes for flash programming routines.
;Refer to Flash Memory System and Programming chapter
SUB
sp,r2,#0x1F
; Initialize the Abort mode stack for RealMonitor
BIC
r1, r0, #0x1f
ORR
r1, r1, #0x17
MSR
CPSR_c, r1
;Keep 64 bytes for Undef mode stack
SUB
sp,r2,#0x5F
; Initialize the IRQ mode stack for RealMonitor and User
BIC
r1, r0, #0x1f
ORR
r1, r1, #0x12
MSR
CPSR_c, r1
;Keep 32 bytes for Abort mode stack
SUB
sp,r2,#0x7F
; Return to the original mode.
MSR
CPSR_c, r0
; Initialize the stack for user application
; Keep 256 bytes for IRQ mode stack
SUB
sp,r2,#0x17F
Rev. 01 — 24 June 2005
Chapter 23: RealMonitor
;Reset Entry point
;User can put address of SWI handler here
;Provided by RealMonitor
;Provided by RealMonitor
;User can put address of FIQ handler here
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
UM10120
250

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2131Lpc2132Lpc2134Lpc2136Lpc2138

Table of Contents