@;======================================================================================== @; OLIMEX LPC-MT board @; LED Blinking program @; @; Originally by: @; FREE WING @; http://hp.vector.co.jp/authors/VA014069 @; Copyright (C)2004 Y.Sakamoto @; @; Modified by senz @; http://arm.dreamislife.com @; @;======================================================================================== PINSEL0 = 0xE002C000 PINSEL1 = 0xE002C004 IOPIN = 0xE0028000 IODIR = 0xE0028008 IOSET = 0xE0028004 IOCLR = 0xE002800C .text .align 2 .global _start _start: bal ResetHandler @;for debug bal . @;handlerUndef bal . @;SWI interrupt handler bal . @;handlerPrefetchAbort bal . @;handlerDataAbort bal . @;handlerReserved bal . @;handlerIRQ bal . @; Remake to save FIQ access time...... ResetHandler: ldr r1,=PINSEL0 ldr r2,=0x00000000 @;default GPIO function 00 //GPIO-12 LED str r2, [r1] ldr r1,=IODIR ldr r2,=0x00001000 @; 0-INPUT 1-OUTPUT 0:31 (12 -LED) str r2, [r1] loop: @; ON LED (GPIO-12) (GPIO LOW-ON) ldr r0,=IOCLR ldr r1,=0x00001000 @; CLR 12 str r1, [r0,#0x00] ldr r4,=100000 1: nop subs r4, r4, #1 bne 1b @; OFF LED (GPIO-12) (GPIO HIGH-OFF) ldr r0,=IOSET ldr r1,=0x00001000 @; SET 12 str r1, [r0,#0x00] ldr r4,=100000 1: nop subs r4, r4, #1 bne 1b bal loop .align 2 .bss