- 论坛徽章:
- 0
|
;Function:Flash LED.asm
;Date:2009/06/22
;Author:creatory
GPFCON EQU 0x56000050
GPFDAT EQU 0x56000054
GPFUP EQU 0x56000058
EXPORT FLASHLED
AREA Init,CODE,READONLY
FLASHLED
;SET GPF4-GPF7 output
LDR R0,=GPFCON
LDR R1,[R0]
BIC R1,R1,#0xFF00
ORR R1,R1,#0x5500
STR R1,[R0]
;disable the up
LDR R0,=GPFUP
LDR R1,[R0]
ORR R1,R1,#0xF0
STR R1,[R0]
LOOP
LDR R2,=GPFDAT
LDR R3,[R2]
;clear the [7:4] bits
BIC R3,R3,#0xF0
;let GPF6 output 0
;1011,0000
ORR R3,R3,#0xB0
STR R3,[R2]
;call delay
LDR R0,=0x2FFFF
BL DELAY
LDR R3,[R2]
BIC R3,R3,#0xF0
;let GPF7 output 0
;0111,0000
ORR R3,R3,#0x70
STR R3,[R2]
;call delay
LDR R0,=0x2FFFF
BL DELAY
LDR R3,[R2]
BIC R3,R3,#0xF0
;let GPF5 output 0
;1101,0000
ORR R3,R3,#0xD0
STR R3,[R2]
;call delay
LDR R0,=0x2FFFF
BL DELAY
LDR R3,[R2]
BIC R3,R3,#0xF0
;let GPF4 output 0
;1110,0000
ORR R3,R3,#0xE0
STR R3,[R2]
;call delay
LDR R0,=0x2FFFF
BL DELAY
B LOOP ;jump back
DELAY
SUB R0,R0,#0x1
CMP R0,#0x0
BNE DELAY
MOV PC,LR
END
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/56374/showart_1973462.html |
|