5 ms·
The PIO peripheral looks incredibly powerful. State machines connected directly to IO pins!
by synack 6y ago
The PIO peripheral looks incredibly powerful. State machines connected directly to IO pins!
- Cixelyn 6y agoYeah! Docs start on page 323 here: https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.pdf https://datasheets.raspberrypi.org/rp2040/rp2040_datasheet.p.... Looks like there's an assembler for programming the PIO peripheral; they seem quite capable with two IO registers and two scratch registers. I've used a similar sort of embedded state machine inside EFM8 microcontrollers before. They're great not just for implementing custom communication protocols, but also for offloading simple tasks: one example I've coded before is that you can offload software key debouncing to the state machine, and even get an interrupt on keypress. This greatly simplifies the main loop as you don't need to dedicate polling time or write debounce calculations!
- synack 6y agoTI's PRU is a similar concept, but the PIO here is simpler. Parallax Propeller also has a similar flavor with lots of small cores doing different things. It's not a new idea, but the PIO looks like a nice balance between capability and complexity. I'm in love with this documentation. It's not just prettier than other vendors' datasheets, it's also got lots of examples, links, tips, and explanations about the "why" in addition to the "how"
- anonymousDan 6y agoCan you give some examples of why this would be useful?
- synack 6y agoAny situation where you have tight timing requirements could benefit from this. The datasheet has several examples demonstrating how the PIO can be used to generate serial clocks based on data output.
- magicalhippo 6y agoShould help to avoid bitbanging when implementing protocols like the 1-wire[1] protocol, or say generating IO pulse sequences for interfacing with non-standard ICs, like this linear CCD sensor[2]. [1]: https://en.wikipedia.org/wiki/1-Wire https://en.wikipedia.org/wiki/1-Wire [2]: https://toshiba.semicon-storage.com/ap-en/semiconductor/product/linear-image-sensors/detail.TCD1304DG.html https://toshiba.semicon-storage.com/ap-en/semiconductor/prod... (page 7 in datasheet)
- alexisread 6y agoThe ability to have all inputs available to all state machines is really useful - they also mention a port of tensorflow lite to the board. So, one example would be preprocessing inputs for feeding directly into tensorflow applications, for ML at the edge (I think that's the buzzword bingo won there!). With 360mb/s I/O bandwidth, that equates to more than FullHD at 60hz, with 16bit colour depth. If you attach say a rpi camera to the I/O you can do signal processing on the image. Same for VGA output.