diff trigger.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
line wrap: on
line diff
--- a/trigger.pio	Tue Feb 25 17:03:51 2025 +1030
+++ b/trigger.pio	Wed Feb 26 11:03:59 2025 +1030
@@ -3,8 +3,7 @@
 ;
 
 .program trigger
-.define DAC_TRIGGER_IRQ 0
-.define CTRL_TRIGGER_IRQ 1
+.define TRIGGER_IRQ 0
 ; Use 1 side set pin for debugging
 .side_set 1
 
@@ -13,8 +12,8 @@
     wait 0 pin 0 side 0
 ; Wait for rising edge
     wait 1 pin 0 side 0
-; Signal DAC SM (which will trigger the control one)
-    irq nowait DAC_TRIGGER_IRQ side 1
+; Signal DAC & ctrl SMs
+    irq nowait TRIGGER_IRQ side 1
 .wrap
 
 % c-sdk {
@@ -37,8 +36,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);
 }
 %}