3 ms·
I've just been getting to grips with the PIO, they are a lot of fun to program. Whilst the instruction set is very limited with only enough memory for 32 of the
by gchadwick 6y ago
I've just been getting to grips with the PIO, they are a lot of fun to program. Whilst the instruction set is very limited with only enough memory for 32 of them you can do some pretty sophisticated things. A key part of the flexibility is the ability to execute incoming data as instructions. You can stream in a mixture of data and instructions via the DMA, the PIO separates the two and uses the instructions to modify execution so a simple loop becomes a lot more flexible. You can easily sync several of them up to. The scanvideo library: https://github.com/raspberrypi/pico-extras/blob/master/src/common/pico_scanvideo/README.adoc https://github.com/raspberrypi/pico-extras/blob/master/src/c... which is for producing video signals (like VGA) on the fly with scanlines supplied by the CPU is a good example of what's possible. You can have multiple scanline PIO running at once, each decoding a compressed RLE format including transparency and it composes them all together on the fly.
If you've ever played one of the Zachtronics games (in particular Shenzhen IO) it feels like the programming in one of those games. Tight constraints but major possibilities when you think about it for a while.