diff ctrl.pio @ 27:e1d8fe3e418a

Run PIOs at 1x with delays and sync. Can now use a single trigger to set both DAC & ctrl. DAC [still] jitters against the ctrl though..
author Daniel O'Connor <darius@dons.net.au>
date Wed, 26 Feb 2025 11:03:59 +1030
parents 6070d2e66b4c
children 600a394629e6
line wrap: on
line diff
--- a/ctrl.pio	Tue Feb 25 17:03:51 2025 +1030
+++ b/ctrl.pio	Wed Feb 26 11:03:59 2025 +1030
@@ -2,23 +2,22 @@
 ; Copyright (c) 2025 Daniel O'Connor
 ;
 
+.define TRIGGER_IRQ 0
+
 .program ctrl
-.define DAC_TRIGGER_IRQ 0
-.define CTRL_TRIGGER_IRQ 1
-
 ; Assert all 0s
     mov pins, null
 ; Wait for start trigger and clear IRQ
-    wait 1 irq CTRL_TRIGGER_IRQ
+    wait 1 irq TRIGGER_IRQ
 .wrap_target
-    out pins 8
-    nop
-    out pins 8
-    nop
-    out pins 8
-    nop
-    out pins 8
-    nop
+    out pins 8 [1]
+    nop        [1]
+    out pins 8 [1]
+    nop        [1]
+    out pins 8 [1]
+    nop        [1]
+    out pins 8 [1]
+    nop        [1]
 .wrap
 
 % c-sdk {
@@ -47,8 +46,7 @@
 
     sm_config_set_clkdiv(&c, clkdiv);
 
-    // Load our configuration, and start the program from the beginning
+    // Load our configuration
     pio_sm_init(pio, sm, offset, &c);
-    pio_sm_set_enabled(pio, sm, true);
 }
 %}