Это видео недоступно.
Сожалеем об этом.
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
Incredible video, thank you for making these kinds of videos where you share the journey you take when learning something new.
Glad you enjoyed it! Thanks for watching!
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!
Thanks for your kind words!
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.
Thanks! You've probably seen my AWG videos and the journey toward reducing the jitter. Sounds like you found your solution. Thanks for watching!
Thanks for this deep dive into PIO I have been trying to workout how to modify the VGA scanline code myself.
You're welcome! Thanks for watching; I hope to get even farther.
A very good video. I liked the Hollerith cards and Fortran, as I have been there and done that too ;-)
Cool, thanks.
Enjoying all the series
That's great! Thanks for watching.
Thank you David! Wonderful series.
Thanks for watching!
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.
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!
amazing content really enjoyed vga output on pico.
Thank you, and thanks for watching!
These videos are great. I just wish I could mute the background music.
I've toned down the background music on recent videos.
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.
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".
@@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.
@@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.
@@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.
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.
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!
Just found your channel. Excellent Content - another sub for you sir!
Awesome, thank you! Make sure to leave any suggestions. Thanks for watching!
Sick
I agree, Graham Sanderson has done a great job! Thanks for watching.
4:45 you can define it as a persistent variable. System Properties > Environment Variables > New
Thank you. I'll try that next time; it should make my life a little easier! :-)
@@LifewithDavid1 dont forget to use absolute full path. The sample is relative path is in the video
I really enjoy your videos! However, there is one correction. 15bit color is not 225 colors but 32,768 colors. 🙂
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!
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.
Thanks for the info! I'm actually working on a video for an AWG that uses an R-2R DAC
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.
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!
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.
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?
@@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.
@@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!
How would I do this with a 400 pin breadboard want to make it sleek
Maybe put the resistor network on a separate board? Kinda like a hat? Sounds interesting. Good luck!
@@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!
@@Foryourenjoyment Fantastic! It sound pretty cool! Thanks for watching!
👍👍👍
Thanks for watching!
Does any chip generate excessive heat which requires a heat sink?
The best way to answer that question is with experimenting with overclocking and your finger.
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.
They probably use something like "racing the beam" rendering, without the need for video ram or a framebuffer.
Yes they do. Each line is calculated just before it it displayed. However, the Mario tiles do sit in some "video RAM".