Это видео недоступно.
Сожалеем об этом.

Raspberry Pi Pico PIO - Ep. 6 - VGA Video and C/C++

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • Join David as he investigates VGA video on a Raspberry Pi Pico (RP2040). What more will we need to know before we can write our own VGA programs?
    00:00 - Introduction
    00:48 - MicroPython vs. C/C++
    01:35 - VGA introduction and Pico Hardware Interface
    03:55 - Setting up to Compile C/C++ Code
    04:58 - Getting and Compiling the Video Demos
    06:44 - Downloading files into the Pico
    07:29 - Video Demonstrations
    08:53 - How does it work?
    10:42 - Closing
    Links:
    VGA Video Interface Design:
    datasheets.ras...
    C/C++ Application installation on Windows Computer:
    datasheets.ras...
    Raspberry Pi Video files:
    github.com/ras...
    github.com/ras...
    Music:
    (Pinnacle 19.5 royalty-free music):
    Pulsing Dance
    House Fever
    Reaction Time
    City Night Groove

Комментарии • 57

  • @cirobermudez
    @cirobermudez 2 месяца назад

    Incredible video, thank you for making these kinds of videos where you share the journey you take when learning something new.

    • @LifewithDavid1
      @LifewithDavid1  2 месяца назад

      Glad you enjoyed it! Thanks for watching!

  • @grantpeterson2524
    @grantpeterson2524 2 года назад +7

    David, your tutorials are so wonderful. Love how you are explaining these concepts for us laymen. I was finally able to get a driver written for my HUB75 LED matrix, driven at 50MHz! This wouldn’t have been possible without an FPGA for me otherwise. Keep it up!

  • @gary7203
    @gary7203 Год назад +2

    I've really enjoyed your Pico videos. I picked one up a month ago, and used your videos to get me started on the right foot. I decided to use the Arduino IDE, which simplifies the build process.
    I built an AWG using PDM, and it worked ok, but required a lot of ram for the dma. I changed it to an 8 but DAC (resistor ladder) saving a ton of ram. My only issue was the added cycles every once in a while to perform the chaining and a few cycles in the dac state machine.
    Then it struck me... create a second state machine that provides the timing for the dac machine. The dac waits for an irq set, clears the irq and writes the data.
    That works like a champ, with no jitter on my output.

    • @LifewithDavid1
      @LifewithDavid1  Год назад

      Thanks! You've probably seen my AWG videos and the journey toward reducing the jitter. Sounds like you found your solution. Thanks for watching!

  • @TheDarkelvenangel
    @TheDarkelvenangel 2 года назад +3

    Thanks for this deep dive into PIO I have been trying to workout how to modify the VGA scanline code myself.

    • @LifewithDavid1
      @LifewithDavid1  2 года назад +2

      You're welcome! Thanks for watching; I hope to get even farther.

  • @alwatt8011
    @alwatt8011 2 года назад +2

    A very good video. I liked the Hollerith cards and Fortran, as I have been there and done that too ;-)

  • @ranhaber1
    @ranhaber1 2 года назад +1

    Enjoying all the series

  • @bialasiczek
    @bialasiczek 2 года назад +2

    Thank you David! Wonderful series.

  • @danman32
    @danman32 7 месяцев назад

    Pi Pico SDK environment using Visual Studio Code has improved quite a bit since when this video was created 2 years ago and I highly recommend installing the SDK environment using the Pico SDK installer.
    As long as you launch VSC using the shortcut the SDK install creates, and you have your CMAKE instructions set up correctly, the VSC will dynamically help you with coding mistakes even before you build/compile your code. It will even provide you the means of finding where a reference, such as a function or variable, is declared, defined or used rather than having to use plain Find all the time.
    I often make stupid syntax mistakes or misuse of data types, and in the past, such as in Arduino IDE, I would not find out about them until I ran a build. But with the VSC and CMAKE plugin, I find these out while I am writing, lowering the time to fix mistakes.

    • @LifewithDavid1
      @LifewithDavid1  7 месяцев назад

      Thanks for the tip. I'll have to try Visual Studio the next time I use C/C++. I've looked at it a couple times before; and the learning curve seemed pretty steep at the time. Recently, I've moved to bare metal assembly so I'm not using the SDK at all. But I'll give it a go next time. Thanks for watching!

  • @yourdailyfails1
    @yourdailyfails1 2 года назад +2

    amazing content really enjoyed vga output on pico.

  • @paulspark7287
    @paulspark7287 Год назад +2

    These videos are great. I just wish I could mute the background music.

    • @LifewithDavid1
      @LifewithDavid1  Год назад +3

      I've toned down the background music on recent videos.

  • @skf957
    @skf957 2 года назад +2

    Thanks for the video. It shows some of the extreme lengths the folks at R-pi went to in order to make the RP2040 the success it is.
    I have a Pico or four, and I went down the C/C++ route almost from the off. I had major issues installing the toolchain onto W.10, but got there in the end thanks to RUclips, ending up with a viable VSC environment. Much easier (if only because there is a runnable script) was when I did the same thing on a R-pi 3b+ When I went back to the W.10 setup, I found it to be broken. Probably something I’d done, but I won’t be fixing it, instead staying on Linux for this type of thing (and everything else as soon as I can). It just feels “right”.
    I experimented (cut ‘n’ paste) with PIO and struggled to get my head around it. Not so much the “assembler”, but the C++ helper programs and how they all interact with one another. Beyond my capabilities, but I just know that the RP2040, with a relatively high clock speed (for a MCU), dual cores and 8 state machines - must be capable of some pretty stunning stuff in the right hands. Not mine though.
    I too worked on System 370 - on DOS/VS then MVS, getting pretty familiar with JCL, EXEC, EXEC2, REXX, VSAM and a lot of the utilities that were in use at that time. Happy days until the bean-counters arrived to spoil the fun. When I retired in 2016, it had become a dire existence. I still miss my early days though, and mucking around with the Pico and the R-pi kind of brings back those memories.

    • @LifewithDavid1
      @LifewithDavid1  2 года назад +1

      Thanks for watching. I agree that RPi has gone above and beyond and I know they will dominate the microcontroller industry the future. I was thinking I should get a RPi 4 and move toward compiling C/C++ in Linux, W10 seems a little fragile.
      As you see can see from my videos, I'm enjoy reliving the days of "little" computing. Hopefully these little systems will keep both of our brains sharp during retirement.
      My issue with JCL was when I was developing a Fortran Finite Element program for class at 3:00 AM, there wasn't any support at the computer center; so I had to figure it out on my own. Nothing like a deadline and trying to learn a new "language".

    • @skf957
      @skf957 2 года назад +2

      @@LifewithDavid1 Totally agree with respect to keeping our brains sharp - I view these little systems as a more fulfilling alternative to crosswords and other such puzzles.

    • @miragj
      @miragj 2 года назад +1

      @@LifewithDavid1 WSL (Windows Subsystem For Linux) is a pretty good way to run Linux stuff in W10, so you could probably use that to get the Pi Pico's C/C++ toolchain up and running in linux on W10, without needing a separate computer for linux.

    • @LifewithDavid1
      @LifewithDavid1  2 года назад +1

      @@miragj Thanks for the tip. I'll have to look into that. Today I really dug into the W10 toolchain and I did make some progress.

  • @miragj
    @miragj 2 года назад +5

    I love this series on Pico's PIO. It's really helping me wrap my head around it. Are you planning on doing more videos about video generation once you've figured it out? Or will you be moving on to other things with the PIO? I'd love to see more about video generation since as you noted the provided code is a bit complicated.

    • @LifewithDavid1
      @LifewithDavid1  2 года назад +4

      Thank you. That's a great question. My next steps are to understand video generation more. To do that I need to learn C/C++, the SDK PIO assembler, DMA and two core operation. I'm going to do videos about the journey; with the goal of writing or modifying video code to do something fun or useful with the Pico. After I understand video, I think other PIO functions like audio will be a piece of cake. In this case it's more about the journey since I already have a handful of RPi Zeros that can run rings around the Pico video wise. I'm getting started; however; I can see it's going to take some time to wrap my thick skull around all I need to know. Thanks for the feedback; we'll see where it goes!

  • @andre-le-bone-aparte
    @andre-le-bone-aparte 11 дней назад

    Just found your channel. Excellent Content - another sub for you sir!

    • @LifewithDavid1
      @LifewithDavid1  11 дней назад

      Awesome, thank you! Make sure to leave any suggestions. Thanks for watching!

  • @sapiosuicide1552
    @sapiosuicide1552 5 месяцев назад +1

    Sick

    • @LifewithDavid1
      @LifewithDavid1  5 месяцев назад

      I agree, Graham Sanderson has done a great job! Thanks for watching.

  • @megri3441
    @megri3441 2 года назад +1

    4:45 you can define it as a persistent variable. System Properties > Environment Variables > New

    • @LifewithDavid1
      @LifewithDavid1  2 года назад +1

      Thank you. I'll try that next time; it should make my life a little easier! :-)

    • @megri3441
      @megri3441 2 года назад +1

      @@LifewithDavid1 dont forget to use absolute full path. The sample is relative path is in the video

  • @cbmeeks
    @cbmeeks 9 месяцев назад +1

    I really enjoy your videos! However, there is one correction. 15bit color is not 225 colors but 32,768 colors. 🙂

    • @LifewithDavid1
      @LifewithDavid1  9 месяцев назад

      You would certainly think so. I'm not sure why I would have said that unless I saw it in some of the RasPi documentation. I see there have been a lot of corrections to the VGA text recently. Nice catch!

  • @jorgeferreira6727
    @jorgeferreira6727 2 года назад

    Nice video, learned a lot about my new toy.
    The problem of the exact values for the resistors can be circumvented using an R-2R ladder for the DACs. A bit more bulky but as all the resistors are the same, the exact value is less critical.

    • @LifewithDavid1
      @LifewithDavid1  2 года назад

      Thanks for the info! I'm actually working on a video for an AWG that uses an R-2R DAC

  • @elektron2kim666
    @elektron2kim666 Год назад

    A little control task is quite simple for me to do with it. The rest is quite complicated. At least I like to learn a thing or two more in that world at my own pace.

    • @LifewithDavid1
      @LifewithDavid1  Год назад

      You're right, these micro-controllers are so flexible that they can be used for really simple control or turned into little computers that would rival mainframes of 60 years ago. Something for everyone. Thanks for watching!

  • @Marc_Wolfe
    @Marc_Wolfe Год назад +1

    May I suggest I2S DACs for color signals to cut down on IO pin usage... Might be some with DC blocking, but I'm sure some don't.

    • @LifewithDavid1
      @LifewithDavid1  Год назад

      Thanks, I'll have to look at those. I'm not sure of their max speed. We have to output a new value every 40 nanoseconds.
      EDIT: I looked into the max speed of the I2S protocol and unfortunately it is about 100 times too slow. Video, even VGA is pretty demanding. Thanks for the suggestion, though. I might have to look into it for sound generation. I'm looking at MIDI now; maybe a tiny synthesizer?

    • @Marc_Wolfe
      @Marc_Wolfe Год назад

      @@LifewithDavid1 Yeah, I tried to come back and edit that comment to say the same; but for some reason it wasn't displaying. Maybe grey scale and some "digital potentiometers"; full speed brightness and some optional color stuff. Wonder how hi res you can go at 60 FPS with just black and white, not grey scale, just full black and full white. Nothing flashy, just information data display stuff. I definitely want to look into that with a Teensy 4.0; found out it has features I want, like USB host and device mode ports simultaneously. Really audio friendly devices; make a graphic equalizer and VU meter or something, along with audio ADC and DAC, plug in an ordinary keyboard and use it as MIDI and to interface with sketch settings adjustments... just throw the kitchen sink at it. Apparently people have done VGA on them already.... Went on a tangent there.

    • @LifewithDavid1
      @LifewithDavid1  Год назад

      @@Marc_Wolfe No problem. For more info on what it takes for video display, please see my PIO episode 12 ( ruclips.net/video/ZEBkM5FQ86Q/видео.html ). That gives the math needed for "low res" VGA at 30 FPS. Grey scale just means you only need one DAC instead of three, but for the same resolution you still need the same speed. For black and white you don't need a DAC at all, just on or off. That should be pretty easy to do. Good luck!

  • @Foryourenjoyment
    @Foryourenjoyment Год назад +1

    How would I do this with a 400 pin breadboard want to make it sleek

    • @LifewithDavid1
      @LifewithDavid1  Год назад +1

      Maybe put the resistor network on a separate board? Kinda like a hat? Sounds interesting. Good luck!

    • @Foryourenjoyment
      @Foryourenjoyment Год назад +1

      @@LifewithDavid1 was able to do it thank you I even was able to do hdmi with the help of the rp community thanks a lot!

    • @LifewithDavid1
      @LifewithDavid1  Год назад +1

      @@Foryourenjoyment Fantastic! It sound pretty cool! Thanks for watching!

  • @adambeedle
    @adambeedle 2 года назад +1

    👍👍👍

  • @zhouyu9971
    @zhouyu9971 Год назад +1

    Does any chip generate excessive heat which requires a heat sink?

    • @SpeccyMan
      @SpeccyMan Год назад +1

      The best way to answer that question is with experimenting with overclocking and your finger.

    • @LifewithDavid1
      @LifewithDavid1  Год назад +1

      In my experience, the Pico running at 125 mHz runs nice and cool for what I used it for. I think a hard overclocking would cook things to the point that a heat sink would be needed; but I don't think so for normal use.

  • @PeetHobby
    @PeetHobby Год назад

    They probably use something like "racing the beam" rendering, without the need for video ram or a framebuffer.

    • @LifewithDavid1
      @LifewithDavid1  Год назад

      Yes they do. Each line is calculated just before it it displayed. However, the Mario tiles do sit in some "video RAM".