Overview
We designed this little breakout board after seeing some cool demos for the Raspberry Pi Pico driving an HDMI display. By using some fun 'abuse' of overclocking and the RP2040's PIO system, a low-cost microcontroller can have great looking video output. Great for making demos, or just noodling around with digital video generation.
This breakout board has no active components on it. It's just a connector you can plug an HDMI/DVI cable into, and 220 ohm series resistors. There's a spot for an I2C EEPROM and some resistors, but those are for advanced folks who may want to create a 'sink' device with an EDID. We don't place those parts on this breakout, since this is intended to be a 'source' only!
Wire it up to the bottom pins of your Pico board with the following:
- GP12 to D0+
- GP13 to D0-
- GP14 to CK+
- GP15 to CK-
- GP16 to D2+
- GP17 to D2-
- GP18 to D1+
- GP19 to D1-
And tie all the grounds together to one ground pin. Then you can download this superfun example that will give you bouncy Eben heads (from this tutorial)
Page last edited March 08, 2024
Text editor powered by tinymce.
Pinouts
Power Pins
- 5 - This is the 5V power pin. It is available for use if you're adding an I2C EEPROM to the board.
- GND pins - These are common ground for power and logic.
Data Pins
The following Transition-Minimized Differential Signaling (TMDS) pins for the DVI connector are available on the breakout board. They transmit highspeed serial data.
- TXC+ and TC- - TMDS clock signal pins. Connects to the DVI port with 220 ohm series resistors.
- TX0+ and TX0- - TMDS channel 0 signal pins. Connects to the DVI port with 220 ohm series resistors.
- TX1+ and TX1- - TMDS channel 1 signal pins. Connects to the DVI port with 220 ohm series resistors.
- TX2+ and TX2- - TMDS channel 2 signal pins. Connects to the DVI port with 220 ohm series resistors.
I2C Logic Pins
There's a spot for an I2C EEPROM and some resistors, but those are for advanced folks who may want to create a 'sink' device with an EDID. We don't place those parts on this breakout.
- C - I2C clock pin, connect to your microcontroller's I2C clock line. Connected to the DVI port's DCLK line.
- D - I2C data pin, connect to your microcontroller's I2C data line. Connected to the DVI port's DDAT line.
Page last edited March 08, 2024
Text editor powered by tinymce.
Raspberry Pi Pico Demo Code
Using the DVI Breakout Board with a Raspberry Pi Pico involves wiring up the breakout to the Raspberry Pi Pico, installing the Raspberry Pi Pico development toolchain, building examples from the PicoDVI repository and flashing the compiled .UF2 files to the Raspberry Pi Pico.
- Pico GP12 to Breakout TX0+ (blue wire)
- Pico GP13 to Breakout TX0- (yellow wire)
- Pico GP14 to Breakout TXC+ (green wire)
- Pico GP15 to Breakout TC- (pink wire)
- Pico GP16 to Breakout TX2+ (white wire)
- Pico GP17 to Breakout TX2- (cyan wire)
- Pico GP18 to Breakout TX1+ (purple wire)
- Pico GP19 to Breakout TX1- (orange wire)
- Pico GND to all three Breakout GND's (black wires)
Toolchain Setup
To work on C/C++ development with the Raspberry Pi Pico, you need to have a toolchain environment setup on your system. There is support for Linux (including running it on a Raspberry Pi), Apple macOS and Windows.
Instructions for setting up the toolchain can be found from Raspberry Pi in their Getting Started with Pico guide:
- For Linux, refer to section 2.1
- For Apple macOS, refer to section 9.1
- For Windows, refer to section 9.2
PicoDVI Installation
After setting up your toolchain and the Pico SDK, you will download and build the PicoDVI software. This software is authored by Luke Wren, an engineer who worked on the RP2040 project at Raspberry Pi.
First, create a new directory called pico and navigate to the directory.
mkdir pico cd pico
Clone the PicoDVI repository from GitHub. Then, navigate to the software folder in the downloaded PicoDVI folder.
git clone https://github.com/Wren6991/PicoDVI.git cd PicoDVI/software
Next, you'll begin compiling the examples. Create a new directory in the software directory called build. Then, navigate to the build folder.
mkdir build cd build
Setup the cmake parameters by assigning the PICO_SDK_PATH to the file location on your system for the Pico SDK. For example, if you setup the Pico SDK to be in your home directory, you would pass PICO_SDK_PATH=~/home/pico-sdk.
It's important to include PICO_COPY_TO_RAM=1 since it increases performance for some of the applications because they use SSI in fast DMA streaming mode.
PICO_SDK_PATH=your/path/to/pico/sdk cmake -DPICO_COPY_TO_RAM=1 ..
After the parameters have been set, you can run make to create the .UF2 files that will run on your Raspberry Pi Pico. This builds all of the example apps.
make -j4
Flashing the .UF2 File to the Raspberry Pi Pico
Choose the example app that you would like to run on your Raspberry Pi Pico. Hold down the BOOTSEL button on your Pico and plug it into your computer's USB port using a USB cable that you know is good for data sync. You can drag and drop the .UF2 file onto the Pico or copy the file via the terminal using cp.
Here is an example of what copying a file via the terminal to the Pico would look like. You would enter the file location for your selected .UF2 file and then enter the location of your RPI-RP2 drive on your system.
cp PicoDVI/software/build/apps/sprite_bounce/sprite_bounce.uf2 /media/username/RPI-RP2/
You can run ls in the PicoDVI/software/build/apps folder to see a list of the available apps.
Running the App
After flashing the .UF2 file, keep your Raspberry Pi Pico plugged in via USB for power. Plug an HDMI cable into the DVI Breakout Board. Connect the other end of the HDMI cable into an HDMI monitor. You should see your application playing on the screen.
Page last edited March 08, 2024
Text editor powered by tinymce.
Sprite Conversion
PNG
If you need to create custom sprite images for one of the demos, such as sprite_bounce, you can use the packtiles script.
First, create a 128x128 pixel .png image and place it in the pico/PicoDVI/software/assets directory. (You can also download one of the lovely sprites provided below.)
Packtiles
Next, from a terminal cd pico/PicoDVI/software (your path may be different depending on where you installed it).
Run this command to convert the pt_128x128.png file:
./scripts/packtiles -sdmf rgab5515 assets/pt_128x128.png assets/pt_128x128_rgab5515.h
This will generate a converted .h file asset that can be compiled into the code.
Edit main.c
To use this new asset in the sprite_bounce demo code, head to pico/PicoDVI/software/apps/sprite_bounce and open main.c in your editor.
You can look for one of the original sprites, such as (around line 24):
include "eben_128x128_rgab5515.h"
and swap that for the new one:
include "pt_128x128_rgab5515.h"
Then, swap out the asset used by the berry[] array:
berry[i].img = i % 2 ? pt_128x128 : raspberry_128x128;
Re-save the main.c file.
Build
Now, you can build the app:
cd PicoDVImkdir buildcd buildPICO_SDK_PATH=path/to/sdk cmake -DPICO_COPY_TO_RAM=1 ..make -j4
This will create the sprite_bounce.uf2 file we need and place it in the pico/PicoDVI/software/build/apps/sprite_bounce directory.
Run It
Now, you can flash the Pico with the new sprite_bounce.uf2 file just as shown previously on the Demo Code page!
Page last edited March 08, 2024
Text editor powered by tinymce.
Downloads
Page last edited March 08, 2024
Text editor powered by tinymce.