I recently bought a couple of Raspberry Pi Pico microcontroller boards. Although I read about the PIO peripheral, I didn't pay too much attention to it. However, it seems to be an interesting peripheral that I haven't seen before on other microcontrollers. It is supposed to be a versatile I/O interface which will allow you to implement custom serial or parallel protocols in a better way than bitbanging a GPIO pin.
Actually, the PIO is made of two blocks, each containing four state machines. These are individual processing units optimized for I/O, with "a focus on determinism, precise timing, and close integration with fixed-function hardware" as the datasheet claims. Sounds good, doesn't it? This is until you get to program these "machines" in... assembly language. I'm totally new to this, so in this post I will generate a square wave signal using the PIO.
