Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
Created April 23, 2018 08:18
Show Gist options
  • Save iamgreaser/c12b87450dbdc9b26330d176664da37f to your computer and use it in GitHub Desktop.
Save iamgreaser/c12b87450dbdc9b26330d176664da37f to your computer and use it in GitHub Desktop.
how to make a light blink on a SAMC21-XPRO kit
.thumb
.text
.global vector_table
vector_table:
.word 0x20007FF0
.word _start+1
.word isr_lockup+1 // NMI
.word isr_lockup+1
.word isr_lockup+1
.word isr_lockup+1
.word isr_lockup+1
.word isr_lockup+1
isr_lockup:
b isr_lockup
.global _start
_start:
// Set up generic I/O
ldr r2, =0x41000000
ldr r0, =0x00008000
str r0, [r2, #0x00] // DIR
ldr r1, =0x00008000
str r1, [r2, #0x10] // OUT
// Looparoo
1: str r1, [r2, #0x10] // OUT
ldr r0, =0x00008000
eor r1, r0
ldr r0, =8000000/3/4
2: sub r0, #1
bne 2b
b 1b
.pool
.bss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment