Philips Semiconductors
AN10369
Philips ARM LPC microcontroller family
FIQ_Handler
B FIQ_Handler
END
Startup Assembly code:
; ---------------------------------------------------------
; Assembler Directives
; ---------------------------------------------------------
AREA asm_code, CODE ; New Code section
CODE32 ;
ARM
code
IMPORT __main ; main not defined
; in this section
EXPORT
start ;
global
symbol
;
referenced
in
;
ivt.s
; ---------------------------------------------------------
start
; Enable interrupts
MSR
cpsr_c,#0x13
; Set SP for Supervisor mode. Depending upon
; the available memory the application needs to set
; the SP accordingly
LDR
SP,=0x4….
; Setting up SP for IRQ mode. Change mode to
; IRQ before setting SP_irq and then
; switch back to Supervisor mode
MRS
R0,
CPSR
BIC
R1,
R0,#0x1F
ORR
R1,
R1,#0x12
MSR
cpsr_c,
R1
LDR
SP,
=0x4….
MSR
cpsr_c,
R0
; Jump to C code
LDR
lr,
=__main
MOV
pc,
lr
END
4.4.2 C
code
#include"LPC210x.h"
void Initialize(void);
© Koninklijke Philips Electronics N.V. 2005. All rights reserved.
Application note
Rev. 01 — 06 April 2005
11 of 17