Philips LPC2194 User Manual page 301

Table of Contents

Advertisement

Philips Semiconductors
ARM-based Microcontroller
Code Example
The following example shows how to setup stack, VIC, initialize RealMonitor and share non
vectored interrupts:
IMPORT rm_init_entry
IMPORT rm_prefetchabort_handler
IMPORT rm_dataabort_handler
IMPORT rm_irqhandler2
IMPORT rm_undef_handler
IMPORT User_Entry ;Entry point of user application.
CODE32
ENTRY
;Define exception table. Instruct linker to place code at address 0x0000 0000
AREA exception_table, CODE
LDR pc, Reset_Address
LDR pc, Undefined_Address
LDR pc, SWI_Address
LDR pc, Prefetch_Address
LDR pc, Abort_Address
NOP ; Insert User code valid signature here.
LDR pc, [pc, #-0xFF0] ;Load IRQ vector from VIC
LDR PC, FIQ_Address
Reset_Address
DCD
Undefined_Address
DCD
SWI_Address
DCD
Prefetch_Address
DCD
Abort_Address
DCD
FIQ_Address
DCD
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.
; *********************************************************************/
LDR r2, =ram_end
MRS r0, CPSR
; 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
RealMonitor
__init
rm_undef_handler
0
rm_prefetchabort_handler ;Provided by RealMonitor
rm_dataabort_handler
0
;Get top of RAM
;Save current processor mode
LPC2119/2129/2194/2292/2294
;Reset Entry point
;Provided by RealMonitor
;User can put address of SWI handler here
;Provided by RealMonitor
;User can put address of FIQ handler here
301
Preliminary User Manual
May 03, 2004

Advertisement

Table of Contents
loading

This manual is also suitable for:

Lpc2129Lpc2119Lpc2292Lpc2294

Table of Contents