Last active
May 15, 2019 12:58
-
-
Save shirriff/5c92abc9a5da759f6c7ef23462708d43 to your computer and use it in GitHub Desktop.
Assembly code to demonstrate the PRU on the BeagleBone Black. This code blinks an LED 10 times.
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
; blink.p: demonstration of PRU on the BeagleBone Black | |
; blink LED connected to P8_11 ten times | |
.origin 0 | |
.entrypoint TOP | |
TOP: | |
MOV r1, 10 ; blink counter | |
BLINK: | |
SET r30, r30, 15 ; set GPIO output 15 | |
MOV r0, 0x00a00000 ; delay counter | |
DELAY: | |
SUB r0, r0, 1 | |
QBNE DELAY, r0, 0 ; loop until r0 == 0 (delay) | |
CLR r30, r30, 15 ; clear GPIO output 15 | |
MOV r0, 0x00a00000 ; delay counter | |
DELAY2: | |
SUB r0, r0, 1 | |
QBNE DELAY2, r0, 0 ; loop until r0 == 0 (delay) | |
SUB r1, r1, 1 | |
QBNE BLINK, r1, 0 ; loop until r1 = 0 (blink counter) | |
MOV r31.b0, 32 + 3 | |
HALT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment