What... exactly is the PIO? - Page 1
Forum section: electronics / general

author: OverlordCheese
author_rank: Contributor
timestamp: September 06, 2022, 12:49:38 pm
content: Hello! I think this is a very basic question that I am struggling with: what... exactly is the PIO on the rpi pico? I've heard its like an FPGA, but also... not even close to one? I don't really get it, and everything I read makes me more confused. can someone just give me the sparknotes?PS: I mean this from a technical and funcional perspective, so like, in what ways can the PIO replace an FPGA?

author: pcprogrammer
author_rank: Super Contributor
timestamp: September 06, 2022, 01:05:58 pm
content: I have no experience with it yet, but you might get better answers when you ask this question in the microcontroller section.You can easily move this thread to it with the button on the bottom of the screen. Also add in the title that it is about the Raspberry PI PICO.Edit: See the attached picture for the move button.

author: Fred27
author_rank: Unknown
timestamp: September 06, 2022, 01:40:27 pm
content: They call it a state machine, but I feel the PIOs seem more like a small separate microcontrollers with a limited (and slightly odd) instruction set. It's ideal for doing something that you might previously have bit-banged. You can now do some similar bit-banging on the PIO but without interfering with the code running on the main ARM cores.

author: SpacedCowboy
author_rank: Frequent Contributor
timestamp: September 06, 2022, 01:52:43 pm
content: If you want to *do* it in an FPGA, there’s aGitHub projectthat does just that.But in general it’s just a way of offloading the CPU from handling tight timing-dependent code typical with custom i/o. They’re pretty useful for a micro where everything happens serially, less so when you can write HDL where lots of things can happen in parallel.

author: janoc
author_rank: Super Contributor
timestamp: September 06, 2022, 03:18:07 pm
content: Here is a short explanation of what it is and how it works:https://blues.io/blog/raspberry-pi-pico-pio/The datasheet for RP2040 contains pretty extensive documentation of it too.Comparison to FPGAs is not quite useful because it is not arbitrarily reconfigurable logic. Fred27's description of it as small co-processors with a very tiny and specialized instruction set is about right. RP2040 is not even the first micro to have this - AFAIK, BeagleBone's PRUs are a very similar idea.

author: ataradov
author_rank: Super Contributor
timestamp: September 06, 2022, 03:52:10 pm
content: It is just a programmable state machine. It is nothing like FPGA, the only way it is close to one is that in FPGA you can also make programmable state machines. But thinking of FPGAs when working with PIOs is counterproductive.

author: langwadt
author_rank: Super Contributor
timestamp: September 06, 2022, 05:51:34 pm
content: Quote from: janoc on September 06, 2022, 03:18:07 pmthe PRUs are much more advanced, they are full blown 32bit cpus with a c compiler, probably comparable in performance to the RP2040

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 06, 2022, 06:40:54 pm
content: It's close to the FlexIO thing on some NXP MCUs. I suggest reading the RP2040 datasheet as it's relatively clearly explained.

author: JustMeHere
author_rank: Frequent Contributor
timestamp: September 08, 2022, 12:16:12 am
content: Looks like it let's you "reassign" IO pins. Need 6 SPI, then "reassign" 6 sets of pins.