Created
July 3, 2017 03:32
-
-
Save ghazanhaider/569546baba2e5e7225939a3bc130c23c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <targets/AT91SAM7.h> | |
.global main | |
main: | |
# Output enable | |
ldr r0, =(PIOA_BASE + PIOA_OER_OFFSET) | |
ldr r1, =PIOA_OER_P18_MASK | |
str r1, [r0] | |
loopreset: | |
# Output set to 1 | |
ldr r0, =(PIOA_BASE + PIOA_SODR_OFFSET) | |
ldr r1, =PIOA_SODR_P18_MASK | |
str r1, [r0] | |
# Counter reset | |
mov r2, #0x0 | |
loopone: | |
add r2,r2,#0x1 | |
cmp r2,#0x00100000 | |
bne loopone | |
# Output set to 0 | |
ldr r0, =(PIOA_BASE + PIOA_CODR_OFFSET) | |
ldr r1, =PIOA_CODR_P18_MASK | |
str r1, [r0] | |
# Counter reset | |
mov r2, #0x0 | |
looptwo: | |
add r2,r2,#0x1 | |
cmp r2,#0x00100000 | |
bne looptwo | |
b loopreset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment