화일이 첨부 안되는군요....
저번에 말씀 드렸듯이 인터럽트를 사용하려고 하는데 ICMR해당 BIT을 0으로 만
들고 CPSR의 FIQ,IRQ BIT을 0으로 만들어서 UART를 통해 데이터가 들어오면 인
터럽트 쪽으로 가서 LED를 켜보아 기본적인 TEST를 하려고 하는데 인터럽트
가 걸리질 안습니다. 소스는 좀 허접이지만 같이 올립니다.
UTCR0_VALUE EQU 0x08 ;8BIT 내부클럭 1STOP NO PARITY
UTCR1_VALUE EQU 0x00
UTCR2_VALUE EQU 0x01 ;115.2K Bit Per Second
UTCR3_VALUE EQU 0x03 ;송수신가능 인터럽트사용안함


SER3_UTCR0 EQU 0x80050000 ;콘트롤레지스터0 주소
SER3_UTCR1 EQU 0x80050004 ;콘트롤레지스터1 주소
SER3_UTCR2 EQU 0x80050008 ;콘트롤레지스터2 주소
SER3_UTCR3 EQU 0x8005000C ;콘트롤레지스터3 주소
SER3_UTDR EQU 0x80050014 ;데이타레지스터 주소
SER3_UTSR0 EQU 0x8005001C ;상태레지스터0 주소
SER3_UTSR1 EQU 0x80050020 ;상태레지스터1 주소
CPU_SPEED EQU 0x90020014

INTERRUPT_ICIP EQU 0x90050000
INTERRUPT_ICMR EQU 0x90050004
INTERRUPT_ICLR EQU 0x90050008
INTERRUPT_ICFP EQU 0x90050010
INTERRUPT_ICPR EQU 0x90050020
INTERRUPT_ICCR EQU 0x9005000C

Mode_USR EQU 0x10
Mode_IRQ EQU 0x12
Mode_SVC EQU 0x13

I_Bit EQU 0x80
F_Bit EQU 0x40

AREA MONITOR, CODE, READONLY
ENTRY


B RESET_JMP
B UNDEFIND_JMP
B SWI_JMP
B Prefetch_JMP
B Abort_JMP
B RESERVED_JMP
B IRQ_JMP
B FIQ_JMP

UNDEFIND_JMP
BL clear_led
MOV r1, #0x01
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x02
STR r1,[r0, #0x0c]
BL delay
BL delay
B UNDEFIND_JMP

SWI_JMP
BL clear_led
MOV r1, #0x02
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x04
STR r1,[r0, #0x0c]
BL delay
BL delay
B SWI_JMP

Prefetch_JMP
BL clear_led
MOV r1, #0x04
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x08
STR r1,[r0, #0x0c]
BL delay
BL delay
B Prefetch_JMP

Abort_JMP
BL clear_led
MOV r1, #0x10
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x20
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x40
STR r1,[r0, #0x0c]
BL delay
BL delay
B Abort_JMP

RESERVED_JMP
BL clear_led
MOV r1, #0x20
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x40
STR r1,[r0, #0x0c]
BL delay
BL delay
B RESERVED_JMP

IRQ_JMP
BL clear_led
MOV r1, #0x40
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x80
STR r1,[r0, #0x0c]
BL delay
BL delay
B IRQ_JMP

FIQ_JMP
BL clear_led
MOV r1, #0x80
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x20000
STR r1,[r0, #0x0c]
BL delay
MOV r1, #0x1000000
STR r1,[r0, #0x0c]
BL delay
B FIQ_JMP

RESET_JMP
BL CPU_SPEED_SET
BL UART_SET
BL INTERRUPT_SET
BL initial_gpio
BL clear_led

MAIN
LDR R1,=INTERRUPT_ICPR
LDR R3,[R1]
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial

LDR R1,=INTERRUPT_ICIP
LDR R3,[R1]
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial

LDR R1,=INTERRUPT_ICFP
LDR R3,[R1]
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial


LDR R1,=INTERRUPT_ICMR
LDR R3,[R1]
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial


LDR R1,=INTERRUPT_ICLR
LDR R3,[R1]
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial


LDR R1,=INTERRUPT_ICCR
LDR R3,[R1]
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial

MRS R3,CPSR
MOV R0,R3,LSR #24
BL Send_Serial
MOV R0,R3,LSR #16
BL Send_Serial
MOV R0,R3,LSR #8
BL Send_Serial
MOV R0,R3
BL Send_Serial

MAIN2

BL clear_led

MOV r1, #0x01
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x02
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x04
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x08
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x10
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x20
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x40
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x80
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x20000
STR r1,[r0, #0x0c]
BL delay
BL clear_led
MOV r1, #0x1000000
STR r1,[r0, #0x0c]
BL delay
BL clear_led

B MAIN2


INTERRUPT_SET
LDR R1,=INTERRUPT_ICMR
LDR R0,=0x00
STR R0,[R1]

; MOV R0, #Mode_SVC:OR:I_Bit:OR:F_Bit
MOV R0, #Mode_SVC
MSR CPSR_c, R0

MOV PC,LR




CPU_SPEED_SET
LDR R0,=CPU_SPEED
MOV R1,#0x0B
STR R1,[R0]
MOV PC,LR


UART_SET
LDR R0, =SER3_UTCR3
MOV R1,#00
STR R1,[R0]

LDR R0,=SER3_UTCR0
MOV R1,#UTCR0_VALUE
STR R1,[R0]
LDR R0,=SER3_UTCR1
MOV R1,#UTCR1_VALUE
STR R1,[R0]
LDR R0,=SER3_UTCR2
MOV R1,#UTCR2_VALUE
STR R1,[R0]
LDR R0,=SER3_UTCR3
MOV R1,#UTCR3_VALUE
STR R1,[R0]
MOV PC,LR



Send_Serial
LDR R1,=SER3_UTSR0
LDR R2,[R1]
TST R2,#1
BEQ Send_Serial
LDR R1,=SER3_UTDR
STR R0,[R1]
MOV PC,LR

initial_gpio
LDR r0, =0x90040000
MOV r2, #1
MOV r1,r2, LSL #24
MOV r2, #1
MOV r3,r2, LSL #17
ORR r1,r1,r3
ORR r1,r1,#0xFF
STR r1,[r0, #0x04]
MOV pc,lr

clear_led
LDR r0, =0x90040000
MOV r1, #0xff
STR r1,[r0, #0x08]
MOV r1,#1
MOV r1,r1,lsl #17
STR r1,[r0, #0x08]
MOV r1,#1
MOV r1,r1,lsl #24
STR r1,[r0, #0x08]
MOV pc, lr

delay
MOV R5,#00
DELAY3 MOV r3,#00
DELAY2 MOV R4,#00
delay1 ADD R4,R4,#1
CMP R4,#0xFF
BNE delay1
ADD R3,R3,#1
CMP R3,#0xFF
BNE DELAY2
ADD R5,R5,#1
CMP R5,#4
BNE DELAY3
MOV pc, lr



END