Implement Controlled Pulses via PIO

This commit is contained in:
AlexanderHD27
2024-09-25 16:39:05 +02:00
parent 49d52ca0ed
commit 9640a5b747
3 changed files with 77 additions and 6 deletions

View File

@@ -0,0 +1,30 @@
.program pulser
clock_div:
PULL NOBLOCK
MOV X, OSR
MOV Y, X
l0:
JMP Y-- l0
IRQ CLEAR 0 REL
; SM 0 + 0 -> IRQ 0
; SM 1 + 0 -> IRQ 1
JMP clock_div
counter:
; SM 2 + 2 -> IRQ 0
; SM 3 + 2 -> IRQ 1
PULL
MOV X, OSR
IRQ WAIT 2 REL
l1:
IRQ WAIT 2 REL [1]
SET PINS, 1
IRQ WAIT 2 REL
SET PINS, 0
JMP X-- l1
JMP counter