Good point! I've added a new section to part 1:The biggest gotcha, or Wat as we seem to be calling it here, IMO is that the PIO are programmed from a perspective of how the ARM-side sees things.
Bonus Wat 2.5: Dr. Dolittle’s PIO Pushmi-Pullyu
Two readers pointed out an important PIO Wat that I missed — so here’s a bonus! When programming PIO, you’ll notice something peculiar:Wat!? Like the two-headed Pushmi-Pullyu from the Dr. Dolittle stories, something seems backwards. But it starts to make sense when you realize PIO names most things from the host’s perspective (MicroPython, Rust, C/C++), not the point of view of the PIO program.
- The PIO pull instruction receives values from TX FIFO (transmit buffer) and inputs them into the output shift register (osr).
- The PIO push instruction outputs values from the input shift register (isr) and transmits them to the RX FIFO (receive buffer).
This table summarizes the instructions, registers, and buffer names. (“FIFO” stands for first-in-first-out.)
Image may be NSFW.
Clik here to view.
Statistics: Posted by carlk — Sun Jan 26, 2025 10:22 pm