Getting Started with picoDVI

PicoGamer v1.2 DIY Edition Tutorial

Getting Started with picoDVI on Raspberry Pi Pico using Arduino IDE

This tutorial will guide you through installing the picoDVI library using the Arduino IDE's Library Manager, configuring it appropriately, and running the Aquarium Screensaver example on your Raspberry Pi Pico. Since you're using a pre-manufactured board with all the hardware already set up, we'll focus solely on the programming steps.

Prerequisites

  • PicoGamer v1.2 DIY Edition microcontroller.
  • Micro USB cable for connecting the PicoGamer to your computer.
  • HDMI or DVI monitor and necessary connectors.
  • Arduino IDE installed and configured for Raspberry Pi Pico.

Table of Contents

  1. Install the picoDVI Library via Library Manager
  2. Load the Aquarium Screensaver Example
  3. Adjust the Configuration to Use pico_sock_cfg
  4. Upload and Test the Example
  5. Troubleshooting
  6. Next Steps

1. Install the picoDVI Library via Library Manager

The picoDVI library enables the Raspberry Pi Pico to output DVI video signals directly from its GPIO pins.

Steps:

  1. Open the Arduino IDE:
    • Launch the Arduino IDE on your computer.
  2. Open the Library Manager:
    • Go to Sketch > Include Library > Manage Libraries...
    • Alternatively, click on the Library Manager icon (bookshelf) in the IDE toolbar.
  3. Search for picoDVI:
    • In the Library Manager search bar, type picoDVI.
    • Look for "picoDVI" by Luke Wren (Wren6991) or "PicoDVI Adafruit Fork" if available.
  4. Install the Library:
    • Click on the picoDVI library entry.
    • Click the Install button.
    • Wait for the installation to complete.
    • Close the Library Manager.

2. Load the Aquarium Screensaver Example

With the library installed, you can now load the Aquarium Screensaver example sketch.

Steps:

  1. Restart the Arduino IDE:
    • Close and reopen the Arduino IDE to ensure it recognizes the new library.
  2. Open the Example Sketch:
    • Go to File > Examples > PicoDVI Adafruit Fork > Screensavers > Aquarium.
    • The sketch will open in a new window.

3. Adjust the Configuration to Use pico_sock_cfg

The example needs to be configured to use pico_sock_cfg for proper operation with your hardware.

Steps:

  1. Locate the Configuration Line:
    • In the Aquarium sketch, scroll down to find the line where the DVIGFX8 display object is initialized.
    • It should look like this:
    DVIGFX8 display(DVI_RES_320x240p60, true, adafruit_feather_dvi_cfg);
  2. Modify the Configuration:
    • Replace adafruit_feather_dvi_cfg with pico_sock_cfg, so the line reads:
    DVIGFX8 display(DVI_RES_320x240p60, true, pico_sock_cfg);
  3. Save the Changes:
    • Go to File > Save to save your modifications.

4. Upload and Test the Example

Now, you'll upload the modified sketch to your Pico and test it.

Steps:

  1. Select the Raspberry Pi Pico Board:
    • Go to Tools > Board > Raspberry Pi RP2040 Boards > Raspberry Pi Pico.
  2. Connect Your Raspberry Pi Pico:
    • Press and hold the BOOTSEL button on your Pico.
    • While holding the button, connect the Pico to your computer using the USB cable.
    • Release the BOOTSEL button after connecting.
    • The Pico should appear as a mass storage device named RPI-RP2.
  3. Select the Correct Port:
    • Go to Tools > Port and select the port labeled as your Pico.
  4. Upload the Sketch:
    • Click the Upload button ( icon) in the toolbar.
    • The IDE will compile the sketch and upload it to the Pico.
    • Wait until you see the message "Done uploading."
  5. Connect to Your Monitor:
    • Connect the HDMI/DVI cable from your Pico's board to your monitor.
    • Ensure the monitor is set to the correct input source.
  6. Test the Output:
    • After the sketch uploads, the aquarium screensaver should display on your monitor.
    • You should see animated aquatic life moving across the screen.

5. Troubleshooting

If you encounter issues, consider the following:

  • No Display Output:
    • Ensure the HDMI/DVI cable is securely connected to both the Pico's board and the monitor.
    • Verify that the monitor is powered on and set to the correct input source.
  • Compilation Errors:
    • Make sure you've correctly modified the configuration line in the sketch.
    • Ensure the picoDVI library is properly installed via the Library Manager.
  • Upload Failures:
    • Confirm that the correct board and port are selected under the Tools menu.
    • Try reconnecting the Pico while holding the BOOTSEL button.
  • Display Issues:
    • If the display is distorted or not as expected, ensure that your pre-manufactured board is functioning correctly.
    • Consult the documentation that came with your board for any specific configurations.

6. Next Steps

Now that you have the aquarium screensaver running, you can explore further:

  • Experiment with Other Examples:
    • The picoDVI library comes with various examples showcasing different graphics and functionalities.
    • Access them via File > Examples > PicoDVI Adafruit Fork.
  • Modify the Sketch:
    • Try changing elements of the aquarium screensaver, such as the speed of the fish or adding new graphics.
    • Explore the code to understand how it works and make your own customizations.
  • Learn More About picoDVI:
  • Share Your Project:
    • Share your results with the community, and see what others have created using picoDVI.

Happy Coding with picoDVI and Your Raspberry Pi Pico!