James Sutherland Puts Infinity at Your Fingertips with a Raspberry Pi Pico-Powered Mandelbrot Toy

Demonstrating just how powerful the RP2040 is, Sutherland's project allows real-time graphical exploration of the Mandelbrot set.

Gareth Halfacree
3 years agoArt

Games developer James Sutherland has been playing around with the Raspberry Pi Pico, and has discovered that its dual-core processor is more than powerful enough for some impressive visualisations — proven in practice using a real-time Mandelbrot fractal explorer.

Released late last month, the RP2040 which powers the Raspberry Pi Pico is a surprisingly powerful microcontroller for a $4 device. As well as its various peripherals, including eight individual programmable IO (PIO) blocks, the chip offers two Arm Cortex-M0+ processors running at up to 133MHz stock — overclockable, if you don't mind exceeding official specifications.

Developer James Sutherland has harnessed the power of both these cores in a project which puts a Mandelbrot set fractal on a compact display panel — offering a real-time exploration of infinity via on-board control buttons.

"[It] does a lower quality render as you're moving, then refines when you stop. My first attempt took around 20 seconds to render each frame, so quite pleased with the optimization at least," Sutherland writes of the project's latest incarnation, written in C. "Now using both cores, each doing half the screen, plus some other optimisations get it to around 10x the speed of my first attempt. [I] added controls so you can fly around in real-time."

"I really didn't expect it to be that fast," Sutherland notes in surprise. "I'm not doing anything hugely clever, either — the CPU is really impressive for the price."

Sutherland isn't the only developer exercising the RP2040 with fractal generation, either: Mike Bell has posted a video of a similar project which also uses both processor cores to improve performance, though in his case he's approached the problem differently by splitting the workload between generating the Mandelbrot set on one core and interpolating and displaying the image on the other.

Sutherland has shared the project on his Twitter feed and on Reddit, while the source code has been published to GitHub.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles