GPFDAT EQU 0x56000054 Port F data
GPFUP EQU 0x56000058 Pull-up control F
AREA myarea, CODE
ENTRY LDR r0, =0x5500
LDR r1, = GPFCON
STR r0,[r1] LDR r0, = 0x0
LDR r1, =GPFUP
STR r0,[r1]
start_while
LDR r0, = 0x0
LDR r1, =GPFDAT
STR r0,[r1] LDR r0, =0xffffloop1
SUBS r0,r0, #1
BNE loop1 LDR r0, = 0xF0
LDR r1, =GPFDAT
STR r0,[r1] LDR r0, =0xffff
loop2
SUBS r0,r0, #1
BNE loop2 B start_whilestop
B stop
END
void delay_10us(void) //10us延时函数,,可重复调用不影响精度{
asm("nop")
asm("nop")
asm("nop")
}
用软件跟踪调试一下就可以,看走了多少步。如不够可以再加asm("nop")
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)