News for hackers. Stuff that matters.
Re:Raspberry Pi Pico and RP2040 Microcontroller by synack on Thursday January 21, 2021 @02:51AM (#25856541)
The PIO peripheral looks incredibly powerful. State machines connected directly to IO pins!
Re:Raspberry Pi Pico and RP2040 Microcontroller by Cixelyn on Thursday January 21, 2021 @03:03AM (#25856605)
Yeah! Docs start on page 323 here: 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!

Re:Raspberry Pi Pico and RP2040 Microcontroller by synack on Thursday January 21, 2021 @03:18AM (#25856671)
TI'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"

Re:Raspberry Pi Pico and RP2040 Microcontroller by anonymousDan on Thursday January 21, 2021 @04:09AM (#25856975)
Can you give some examples of why this would be useful?
Re:Raspberry Pi Pico and RP2040 Microcontroller by magicalhippo on Thursday January 21, 2021 @04:50AM (#25857192)
Should 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

[2]: https://toshiba.semicon-storage.com/ap-en/semiconductor/prod... (page 7 in datasheet)

Re:Raspberry Pi Pico and RP2040 Microcontroller by synack on Thursday January 21, 2021 @04:24AM (#25857053)
Any 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.
Re:Raspberry Pi Pico and RP2040 Microcontroller by alexisread on Thursday January 21, 2021 @07:13AM (#25858077)
The 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.

Re:Raspberry Pi Pico and RP2040 Microcontroller by megous on Thursday January 21, 2021 @07:33AM (#25858193)
It's not. 60 * 1920 * 1080 = 124.416MHz pixel clock. (and that's without any space for blanking times)
Re:Raspberry Pi Pico and RP2040 Microcontroller by tyingq on Thursday January 21, 2021 @09:08AM (#25858918)
Someone managed 640x480 pixel doubled DVI bitbanging: https://github.com/Wren6991/picodvi
Re:Raspberry Pi Pico and RP2040 Microcontroller by 0zelot on Thursday January 21, 2021 @01:33PM (#25862239)
this some one is part of that chips' engineering team :-)
Re:Raspberry Pi Pico and RP2040 Microcontroller by megous on Thursday January 21, 2021 @12:37PM (#25861570)
Awesome. :)
Re:Raspberry Pi Pico and RP2040 Microcontroller by tyingq on Thursday January 21, 2021 @01:25PM (#25862168)
I just noticed it's because they overclocked to 252MHz vs the rated 133Mhz. Heh.