Projects~PIO~pico.txt see fadeLed.pio sigGen.pio also see Article 164, 193 Source 01: https://ephotocaption.com/a/186/MagPi119.pdf pp54 by Ben Everard July 2022 Source 02: Article S166:03 PicoMite (MMBASIC) who writes Fortunately, RP2040 has a little trick up its sleeve: Programmed input/output (PIO). This lets you attach a state machine (basically a very simple processor) to some I/O pins and do some simple processing. Crucially for us, they have very accurate timings. We've looked at PIO a few times before, so we won't cover it in detail, but the program we load into the state machine is: @asm_pio(out_init=(PIO.OUT_LOW, PIO.OUT_LOW,PIO. OUT_LOW,PIO.OUT_LOW,PIO.OUT_LOW,PIO.OUT_LOW,PIO. OUT_LOW,), out_shiftdir=PIO.SHIFT_RIGHT def seven_bit_dac(): label("loop") pull() out(pins, 7) [2] out(pins, 7) [2] out(pins, 7) [2] out(pins, 7) jmp("loop") etc /Projects~PIO~pico.txt