@@ -43,7 +43,6 @@ dotloop:
4343
4444; Data East/Sega frame start detection
4545; ~7.86µs is the longest state in which DE can be low without it being a new frame
46- ; Each nop [31] = 32 cycles = 256 ns @125 MHz
4746; We go with 10 µs to be safe and confirm the start of a new frame, which is 256ns * 39 = 9.98 µs
4847
4948wait_low:
@@ -57,7 +56,7 @@ delay_loop:
5756
5857 ; After ~10 µs, check if still low
5958 jmp pin, wait_low ; If pin went high early → back to wait_low
60- irq 4 ; Pin remained low long enough → trigger IRQ
59+ irq FRAME_START ; Pin remained low long enough → frame started
6160
6261 wait 1 gpio DE ; Wait again for it to go high before restarting cycle
6362 jmp wait_low ; went high, time to go back to wait_low
@@ -73,11 +72,9 @@ static inline void dmd_reader_desega_program_init(PIO pio, uint sm, uint offset)
7372 sm_config_set_in_pins(&c, 2); // SDATA
7473
7574 // Set the pin direction at the PIO
76- pio_sm_set_consecutive_pindirs(pio, sm, 5, 1, false); // RCLK
7775 pio_sm_set_consecutive_pindirs(pio, sm, 2, 2, false); // SDATA, DOTCLK
7876
7977 // Connect these GPIOs to this PIO block
80- pio_gpio_init(pio, 5); // RCLK
8178 pio_gpio_init(pio, 3); // DOTCLK
8279 pio_gpio_init(pio, 2); // SDATA
8380
0 commit comments