Home

Awesome

This repo is similar to pico-examples but utilizing additional libraries from pico-extras

Note that most of these examples are neither fleshed out nor well documented. They mostly serve the purpose of playing with/testing particular areas of functionality (mostly audio/video related)

Finally, you may wonder why many of these demos set the system clock to 48Mhz. The reason is that until we had physical chips, we were running at a fixed 48Mhz system clock using an FPGA. Most of these examples were written before the RP2040 design was final, so they were all developed with that fixed 48MHz system clock. As a result some of the examples do things in a way that you wouldn't necessarily need to if you had more clock speed available (which you do), but on the plus side, you have that much more time to do even more things!

Full Applications

NameDescription
popcornThis is a movie player for 30fps 320x240 movies with 44100 stereo sound, read in a custom format from SD card... it can even play backwards :-) Sample movie file linked from here.
usb_sound_cardA no frills but functional USB sound card... hooked up via our old (pre TinyUSB) USB device stack. Keeping it around as it works nicely!

Audio

NameDescription
sine_wave_i2sA simple sine wave audio output using I2S.
sine_wave_pwmA simple sine wave audio output using PWM.
sine_wave_spdifA simple sine wave audio output using S/PDIF.

Scanout Video

In scanout video, every pixel is driven by the PIO every frame, and a framebuffer is not (necessarily) used (which is useful when you only have 264K of RAM).

For a fuller description of scanout video see here

NameScreenshotDescription
demo1So named because it was the first demo program written that used video.. it is a bit dated now and hails from a time where there was much less RAM on the RP2040
demo2A little variation on demo1 for RP2350. Displays a RISC-V logo also; if built for RISC-V the RISC-V logo is in front; if built for Arm, it is behind
flash_streamStreams video data out of flash fast enough to drive 640x480x60fps bitmap display
hscroll_dma_tilesA horizontal scrolling test app which uses a second video plane (PIO) to overlay sprites
mandelbrotA mandelbrot generator using a 320x240x16 framebuffer
mario_tilesConfusingly named as a reference to Super Mario Kart's tiled psuedo-3D rendering. This is similar to hscroll_dma_tiles except the whole tiled scrolling area is now rotated and zoomed.
scanvideo_minimalA very basic video output generator which generates a test pattern
renderA very dated rendering library used by demo1 - avoid!
spriteA small sprite library used by sprite_demo
sprite_demoSome bouncing Eben heads
test_patternDisplay color bars
textmodeShows off chained DMA to generate scanlines out of glyph fragments via DMA/PIO

The above are intended to be used with the VGA demo board as described in Hardware Design with RP2040 however it is possible to wire your own VGA output according to the following schematic:

Sleep

Examples of using low power mode; these use pico_sleep from pico_extras which is not yet stable.

NameDescription
hello_dormantDemonstrates dormant mode
hello_sleepDemonstrates low power sleep and waking from RTC

Stdio

Examples of adding additional stdio support. Note the interface for stdio drivers is not yet considered stable even though it is in the Pico SDK

NameDescription
stdio_pioDemonstrates adding a custom STDIO driver using a PIO UART