←back to thread

263 points chaosprint | 3 comments | | HN request time: 0s | source
Show context
unixfg ◴[] No.45754629[source]
Would this have been possible without PIO?
replies(2): >>45754766 #>>45755273 #
codebje ◴[] No.45755273[source]
On a Pico? No - the PIOs replace other peripherals a µC might be able to use to achieve this sort of bitrate, so you'd not really have the tools you'd need to change GPIO pin states once every 3-4 CPU clock cycles.

In a sense the PIO is a bit 'cheaty' when claiming "bit-banging", because the PIO is the ultimate peripheral, programmable to be whatever you need. It's no mean feat to make the PIO do the sorts of things happening here, by any stretch, but "bit-banging" typically means using the CPU to work around the lack of a particular peripheral.

From that perspective, there's precious few µCs out there that could bit-bang 100MBit/s Ethernet - I'm no expert, but I _think_ that's a 125MHz IO clock, so if you want 4 CPU cycles per transition to load data and push it onto pins, you're looking for a 500MHz µC, and at those speeds you definitely have to worry about the bus characteristics, stalls, caching, and all those fun bits; it's not your old 8-bit CPU bit-banging a slow serial protocol over the parallel port any more.

replies(5): >>45755402 #>>45755789 #>>45756583 #>>45757107 #>>45767713 #
1. bitwize ◴[] No.45757107[source]
It's why I call the Pico a "headless Amiga"—the PIOs are basically Coppers but for general I/O instead of tied to a display.

I just wish the toolchain weren't so janky...

replies(1): >>45761909 #
2. pflanze ◴[] No.45761909[source]
There's an independent reimplementation of the PIO assembler here: https://crates.io/crates/pio -- I haven't tried it so don't know how good.
replies(1): >>45765020 #
3. bitwize ◴[] No.45765020[source]
Intriguing, but I'm referring to the toolchain as a whole. Everything is done with CMake mumbo jumbo that is a pain to set up. For a computer this small and simple there should be a straightforward "compile .c to .o, link .o to flashable binary, flash binary" that any user can type in at the shell or put into a Makefile.