I'm working on incrementally adding complexity to PIO programs to learn how to use them. Here are a few examples. Note that I'm using Pin 6 for the LED on the Arduino Connect Nano RP2040 board. I think the pin is different for the Pi Pico.
Saturday, July 23, 2022
RP2040 Micropython PIO - Part 1 - Blinking nop, jmp, and .side experiments!
The most simple classic blinking example - toggle a pin on and off with the slowest freqency (2000) and a bunch of nop waits to slow the blinking down enough that we can see it!
set(pins, 1) 
set(pins, 0) 
# sm = rp2.StateMachine(0, pio_junk.blink, freq=2000, set_base=Pin(6))
In this example, we use sideset to toggle the LED pin on and off and jmp to loop for more nop.
Normally, in each PIO assembled instruction, 5 bits are available to specify length of wait, so 0-31 wait cycles. But when we enable sideset, 2 (or more??) bits are used to specify the sideset value. In this case, we use Pin 6 (the LED) as the sideset pin, and we have a max wait of 7 (three bits).
This speeds up the program execution without a bunch more nop calls. So we can count on the x scratch register to repeatedly call nop with a jmp and slow the blinking enough that we can see it, like before using sideset and the longer  wait.
# sm = rp2.StateMachine(0, pio_junk.side_blink, freq=2000, sideset_base=Pin(6))
I'm trying to read the value of all of the pins and put the values into the fifo to be used by the Micropython program...