.global CM3_proc0
.thumb_func
CM3_proc0:
ldr r1, =0x40011010 @ PORT C BSRR register.
mov r2, 0x00001000 @ Set bit 12.
str r2, [r1]
mov r0, 0x1 @ Yield system call.
svc @ Perform the system call.
mov r0, 0x800000 @ Delay loop.
loop0:
sub r0, 0x1
cmp r0, 0x0
bne loop0
b CM3_proc0
A blog about my spare time projects in the microcontroller electronics area. My recent projects include a simple PIC-based television remote control and an MP3 player, based on the PIC 18F25J10 and the VS1011 MP3 decoder. Currently I am learning more about the Cortex M3 CPU, developing a simple RTOS running on the STM32 microcontroller.
Wednesday, June 10, 2009
Flash a LED!
Yesterday, I configured GPIO port C to be able to flash the status LED. I now have two processes yielding to each other. One of them turns on the LED, the other turns it off. Here is one of them. It writes to the GPIO C BSRR (bit set/reset register) to set port C bit 12 high, which turns the LED off.
Subscribe to:
Posts (Atom)