What is VGA and How to Use it With a Raspberry Pi Pico

  Переглядів 48,816

Gary Explains

Gary Explains

Рік тому

VGA is de-facto PC video standard. It is an analogue video system with a heritage from the IBM PS/2. The Raspberry Pi Pico is fast enough to generate a VGA signal in real time! In this video I look at VGA, how it works, and how to build a simple DAC for generating a VGA signal using the Pico.
RP2040 Doom: DOOM1 Demo/Gameplay on a Raspberry Pi Pico: • RP2040 Doom: DOOM1 Dem...
Let Me Explain T-shirt: teespring.com/gary-explains-l...
Twitter: / garyexplains
Instagram: / garyexplains
#garyexplains

КОМЕНТАРІ: 113
@jakemeyer8188
@jakemeyer8188 Рік тому
I genuinely love the time we live in. All this with a few dollars in hardware, an infinite resource of info readily available, and even the ability to design and get your own custom circuit boards made for the price of a Starbucks coffee and sent directly to your door in a matter of days. Our only constraint is a choice of ignorance. Love it!
@kortaffel
@kortaffel Рік тому
Ben Eater talked about this for hours, for anyone who wants to spend a day on this topic
@alatnet
@alatnet Рік тому
There's also James Sharman too. He's made a pipelined 8 bit cpu and is currently working on adding vga to his.
@alinaqirizvi1441
@alinaqirizvi1441 Рік тому
Where?
@Paul_Bearden
@Paul_Bearden 4 місяці тому
No, you are incorrect. Although Ben Eater used the VGA standard, his janky breadboard computer used a framebuffer.
@Wolfennar
@Wolfennar Рік тому
Gotta admit, never would've thought that a microcontroller like the pico could be powerful enough to play a game, render it, and drive an output image. Absolutely mind blown.
@w2tty
@w2tty Рік тому
This is the first decent explanation of VGA I have seen. Thank you. Yes, I would be interested in SD card and audio as well.
@GaryExplains
@GaryExplains Рік тому
Awesome, thank you!
@critical_always
@critical_always Рік тому
What I find amazing is how technology that seemed way beyond my understanding eventually becomes easy and obvious when explained well.
@AlMartinsvidplace
@AlMartinsvidplace Рік тому
Great explanation of VGA for the pico. Some of you may find the PicoMiteVGA implementation interesting....basic on a pico with vga support...and the graphics commands needed. I have not messed with the VGA version yet but the regular PicoMite seems to work well. The fellow who did the MaxiMite boards brought Basic over to the pico. So now we can have an 80's micro in the form of a pico microcontroller board.
@afreestone101
@afreestone101 Рік тому
I second this recommendation, having built up a Picomite myself on some Veroboard. While the hard coded graphics demos referenced in this video look very impressive, the Picomite is a nice little project which turns your Pico into a fully self-contained computer running BASIC (just add a PS2 keyboard and VGA monitor). That may not sound too impressive but if you're familiar with the Maximite and other MMBASIC running platforms, you know that BASIC running on this modern hardware is a fast if not faster, than machine code running on 1980's hardware. Lots of fun to play with.
@dh2032
@dh2032 9 місяців тому
@@afreestone101 BASIC in the was not fastest, but it was never slow, there was a lot a bad programming, even being manly used as stepping stone to something, else, with the excuse , X programming language does not have command X, so we wont discuses that here? more on basic is slow, professionals use x, y, z, but not, basic even if was not the fastest, that down compiler used, and hardware it was run on, 4 or 8mhz cpu's and memory 32k or 64k, it computer 510k or more you where in mainframe business stuff, now a days there some discreet logic on the motherboard somewhere that's using many time that
@dh2032
@dh2032 9 місяців тому
@@afreestone101 BASIC in the was not fastest, but it was never slow, there was a lot a bad programming, even being manly used as stepping stone to something, else, with the excuse , X programming language does not have command X, so we wont discuses that here? more on basic is slow, professionals use x, y, z, but not, basic even if was not the fastest, that down compiler used, and hardware it was run on, 4 or 8mhz cpu's and memory 32k or 64k, it computer 510k or more you where in mainframe business stuff, now a days there some discreet logic on the motherboard somewhere that's using many time that
@samneggs1
@samneggs1 Рік тому
Great video, Gary and great topic. You have my vote for more obscure, esoteric things you can do with the Pico.
@markwarburton8563
@markwarburton8563 Рік тому
Thanks Gary for the explanation of how the VGA can be produced. The video you shared was truly mindblowing. I've seen microcontrollers used to play snake or other simple games, but it is truly mindblowing that a microcontroller can emulate a PC to play a (relatively) sophisticated 3D graphics game. Wow!
@leskaighin8903
@leskaighin8903 Рік тому
Very interesting explanation of VGA, well worth making and watching.
@markhatch1267
@markhatch1267 10 місяців тому
Ohhh! I get it now! Thank you for your excellent explanation of how a VGA signal and interface really works.
@anurasenarathna1703
@anurasenarathna1703 Рік тому
Very good explanation on VGA signal, and creating VGA from PICO. Thank you for sharing your knowledge.
@GaryExplains
@GaryExplains Рік тому
Glad it was helpful!
@daviddavies3637
@daviddavies3637 Рік тому
Great explanatory video. Reminded me of the Atari 2600. This is similar to how the Atari 2600 has to be coded but at much lower resolution because the 6502 doesn't have enough grunt in it and each instruction takes at least two clock cycles, IIRC. But here the PIO takes up much of the grunt work that has to be done in software on the 2600. There is no buffer of any kind on that thing and because virtually all its time is taken up drawing the screen, most of the extra code has to be performed in the VBLANK area (what you call the Front Porch at the top of the screen).
@sinjhguddu4974
@sinjhguddu4974 Рік тому
Informative tutorial, thank you.
@GaryExplains
@GaryExplains Рік тому
Glad it was helpful!
@RonSheely
@RonSheely 5 місяців тому
Thank you Gary.
@anirudhkaviya9143
@anirudhkaviya9143 4 місяці тому
Very well explained sir!
@GaryExplains
@GaryExplains 4 місяці тому
Glad you liked it
@jonathanstein6056
@jonathanstein6056 Рік тому
The RP2040 and its PIO are fantastic. Half-step between microcontrollers and FPGAs. Like VIDOR.
@webmasterg3526
@webmasterg3526 Рік тому
Very good Gary but the PicoMiteVGA is a more complete implementation and already avaialble. Uses the 2nd ARM CPU and one of the PIOs to generate VGA without impacting the very fast MMBasic running on the other CPU. High level graphic commands and sprites, file system via both SD card and onboard Flash. Some very clever people have developed the 'Mite' over the past 12 years or so (previously on the PIC32) and it's really impressive. They are busy working on a Picomite-based (6-8 channel) Logic Analyser at the moment - it uses PIO DMA transfers (controlled by MMB) to achieve the speed. Just built a PicomiteVGA 'home computer' for my Grandson's birthday - software a free download, hardware just a Pico and a few components. Very inexpensive and much easier to do for us programming Dummies! 🙂
@aleXelaMec
@aleXelaMec Рік тому
THIS IS JUST CRAZY SMART!!!! I DONT HAVE ANNYTHING TO SAY!!! Simple and genius!!!!
@fallenrepublic6342
@fallenrepublic6342 Рік тому
wow ....just wow....i feel like i am learning the esoterica of a secret religion....super awesome content. Thanks for sharing your knowledge...
@VarunaSingh89
@VarunaSingh89 Рік тому
I think technically the port is called D-sub? Great video!
@dutchdykefinger
@dutchdykefinger Рік тому
It is indeed
@SchoolforHackers
@SchoolforHackers Рік тому
Yup, commonly called db19, though it’s really de19. Ah, the old days.
@fluiditynz
@fluiditynz Рік тому
It's interesting if you look at the Espressif ESP32 variants how many of them have co-processors that aren't well known. For example ESP32-S3 has two LX7 ARM main processors and two ULP coprocessors, one based on RISC-V instruction set architecture (ULP-RISC-V) and the other on finite state machine (ULP-FSM). The clock of the coprocessors is the internal fast RC oscillator. C3 and C2 look to be missing out on these. While the coprocessor speeds appear at first glance to be very constrained by the RTC clock speed, don't forget that the ESP32 units contain DMA. While a micro like the C3 needs highly structured multitasking to run real time tasks in addition to something like VGA (And doesn't have that many pins anyway), most of the other ESP32 variants do have the capacity. Many of the pheripherals support DMA which substantially offloads urgent tasks when used. If the ULP can be switched to run at a higher clock speed, there's a lot more can be done with many of the Espressif chips. And they have built in Wireless. That's the main thing putting me off doing much with the RP2040 dev boards. On the flip side of that, I developed a PCB years ago using an OSD chip. Around the time I started populating the board, I found the OSD chip was going obsolete, so it's great to see projects like the VGA hat and the HDMI hat for the RP2040. I would think that typical sorts of tasks the ULP would be well suited for would be things like remote control IR code bit banging, reading and writing other custom bit banged protocols. Not sure how much connectivity the low power RISC-v sub core has on the S3 to the main pheripherals? Of course there's also the possibility that the processors are not fully available, for example they may get priority tasks from the 2.4G subsystem, I don't know if that stuff is in embedded code or if it's implemented in an FPGA realised as a subset ASIC block on chip.
@captainpumpkinhead1512
@captainpumpkinhead1512 Рік тому
I kind of want to build a custom RP2040 dongle that just plugs into USB and VGA to output something like this. That's be so cool!
@Darkk6969
@Darkk6969 Рік тому
Imagine going back in the 1980s with Pico running Pac-Man and show the designers with their multi PCB boards down to the size of a cigarette lighter. lol
@DavidAlsh
@DavidAlsh Рік тому
Love this series on embedded programming. Would love a USB driven GPIO board I can plug directly into my PC and not need a Pi or Arduino!
@GaryExplains
@GaryExplains Рік тому
There is a thing called the GPIO Expander that works with the Pi Zero. I haven't tried it, but here is the link: magpi.raspberrypi.com/articles/pi-zero-gpio-expander
@paulmichaelfreedman8334
@paulmichaelfreedman8334 Рік тому
Dude the Pi Pico IS a usb driven GPIO board, in a sense.. You can use thonny and micropython for example to edit the program ON the pico so all you have to do is hit F5 and the code runs. If it's about memory and speed, I concede of course.
@sundhaug92
@sundhaug92 Рік тому
8:23 I think the diagram is wrong, it connects the 2k ohm resistor for blue to ground instead of GP13 (17), and the 1K ohm resistor for GREEN to GND. I believe this was caused by just copying the connection-pattern from RED and not checking the ground-pins
@GaryExplains
@GaryExplains Рік тому
Yes it is wrong. Please see the other discussions about that here in this comment section.
@joegee2815
@joegee2815 Рік тому
If nothing else, it's great for teaching people how graphics adapters work at the most basic level.
@theosib
@theosib 2 години тому
I did this too!
@DylanMatthewTurner
@DylanMatthewTurner Рік тому
Pico DVI is also a thing (and works over HDMI)
@clearwater1231
@clearwater1231 Рік тому
Digital to audio. Bada bing bada boom
@simonabunker
@simonabunker Рік тому
I guess you could write a MicroPython extension in C, but the interpreter will use up some of that precious memory!
@geoffmorrison3648
@geoffmorrison3648 Рік тому
A simple doubling of resistor value between bit positions does not give a linear output. Consider the 500 and 1000 values. If only the GPIO with the 500 resistor is high the voltage across the 75 ohm in the display is proportional to 75/(500+75) = 0.1304 When only the 1000 ohm one is energised the voltage across the 75 is proportional to 75(1000+75) = 0.0.0698. Clearly the first of those is less than twice the second. For the 8K resistor it is 75(8000+75) = 0.009288. The ratio between the outputs from the 500 and 8000 is only 14.043 instead of the ideal 16.
@auglau1
@auglau1 2 дні тому
Is it possible to use 1 pin with 1 resistor pwm to replace the 5 pins with resistors
@jasontiscione1741
@jasontiscione1741 Рік тому
What if I need VGA input? I have a 16x16 neopixel grid here.
@matiasvaldothebird4043
@matiasvaldothebird4043 7 місяців тому
Does anyone know what the component (47) that they placed in hsync and vsync is?
@matiasvaldothebird4043
@matiasvaldothebird4043 7 місяців тому
47ohms?
@helmutzollner5496
@helmutzollner5496 Рік тому
Why is the 2k resistor in the blue section in your diagram connect to ground and not to GP13?
@GaryExplains
@GaryExplains Рік тому
Unfortunately there are some mistakes in the diagram. The red channel is correct.
@VioletGiraffe
@VioletGiraffe Рік тому
Is the same doable with ESP32? It's similar in performance and RAM (more RAM, I think - 320K), but I don't know if it has hardware DMA which seems crucial.
@SadiqueKhan449
@SadiqueKhan449 9 місяців тому
Yes
@SadiqueKhan449
@SadiqueKhan449 9 місяців тому
This will surely able to run cyberpunk 🎉🎉
@misterhat5823
@misterhat5823 Рік тому
There's errors in your diagram at 8:17. Your resistor ladders some resistors connected to ground and the GPIO is left open.
@GaryExplains
@GaryExplains Рік тому
I think you are mistaken. Also, the diagram comes from the Raspberry Pi people, not me.
@misterhat5823
@misterhat5823 Рік тому
@@GaryExplains I'd have to disagree. That diagram is wrong.
@GaryExplains
@GaryExplains Рік тому
Which resistors are connected to ground and the GPIO left open?
@misterhat5823
@misterhat5823 Рік тому
@@GaryExplains On the green channel: GP8 is left open and the 1K is tied to ground. On the blue channel: GP13 is left open and the 2K is tied to ground. The red channel appears to be correct. Please check what you are posting instead of being defensive with critiques.
@GaryExplains
@GaryExplains Рік тому
First, my apologies, you are correct. I didn't spot those mistakes. As I said the diagram is from the official Raspberry Pi github repo. It appears that a bug report was raised in Nov 2021 about this github.com/raspberrypi/pico-playground/issues/20 but it has yet to be fixed. Can I just say that if you had just led with that info, this thread would have gone much better.
@gregdaweson4657
@gregdaweson4657 Рік тому
Why can my vga make 1080p if it is so much smaller in the video?
@bertblankenstein3738
@bertblankenstein3738 Рік тому
The E12 values might be 470, 1000, 2200, 3900 and 8100. That should be closer enough.
@massimookissed1023
@massimookissed1023 Рік тому
2x 1k in parallel = 500 Ω 1x 1k = 1k 2x 1k in series = 2k 1.8k + 2.2k = 4k 3.3k + 4.7k = 8k
@wulfboy_95
@wulfboy_95 Рік тому
-HDMI- DVI is actually possible on the RPi Pico.
@wayland7150
@wayland7150 Рік тому
That would be a better option if possible. It actually ought to be easier as long as the Pico can keep up.
@PhyChris
@PhyChris 9 днів тому
240p possible?
@VioletGiraffe
@VioletGiraffe Рік тому
My 386DX-40 PC with 4 MB of RAM cannot really run DOOM - it's too slow (no FPU). And the Pico with 320K can? The CPU is faster for sure, but what about RAM? DOOM requires 4MB at the minimum.
@openBSDguru
@openBSDguru Рік тому
would be cool if someone could come up with some sort graphics card based on the pico with an ttl interface so that ppl could use it on their homebrew computers. maybe even sprites might be possible.. just dreaming..
@taoyang9843
@taoyang9843 Рік тому
I just sold my 10 years old AOC monitor(1920x1080) for ¥90($13), last week. 😭. How I wish that I had seen this video earlier.
@jensschroder8214
@jensschroder8214 Рік тому
I think the Pico will be 70% busy and full with VGA. You have to program really fast and efficiently to squeeze everything in there. Therefore everything in C++ and not in python. Each higher Lib will again need space and CPU time. The 8 bit computers of the 80's had their own IC that took care of the video and not the CPU.
@GaryExplains
@GaryExplains Рік тому
Yes that might all be true but the Pico is a dual core processor so there is another whole core sitting there doing nothing. Also, it is powerful enough to play Doom, do that kind of proves what it is capable of doing.
@TheFerdi265
@TheFerdi265 Рік тому
If you code efficiently you can definitely get a lot out of it. If you do it right you can even get VGA output plus a basic animated effect in less than 1.5 kilobytes (for the whole .bin file; 3KB for the .uf2, always twice the size)
@1MarkKeller
@1MarkKeller Рік тому
*GARY!!!* *Good Evening Professor!* *Good Evening Fellow Classmates!* Stay Safe Out There Everyone!
@GaryExplains
@GaryExplains Рік тому
MARK ‼️‼️
@SpeccyMan
@SpeccyMan Місяць тому
A gun? Try three guns - one for each of the colours red, green and blue!
@randysmith7094
@randysmith7094 Рік тому
It doesn't have enough memory for a 480p frame buffer but it can run Doom? That is extremely hard to believe.
@GaryExplains
@GaryExplains Рік тому
There are other techniques besides frame buffers. The code is here try it for yourself: github.com/kilograham/rp2040-doom
@GaryExplains
@GaryExplains Рік тому
Also the port runs as 320x200x60 not 480p. More details here as well: kilograham.github.io/rp2040-doom/
@randysmith7094
@randysmith7094 Рік тому
@@GaryExplains This guy seems to be the only one with videos of this Pico Doom. Honestly looks pretty sus' to me. I'm simply not going to believe this until I see some independent setup videos.
@GaryExplains
@GaryExplains Рік тому
That is your choice. It isn't my job to convince you.
@TT-it9gg
@TT-it9gg Рік тому
The schematic is wrong. You connect two pins to GND....
@GaryExplains
@GaryExplains Рік тому
Yes, that is a mistake. The diagram is from the official Raspberry Pi github repo. It appears that a bug report was raised in Nov 2021 about this github.com/raspberrypi/pico-playground/issues/20 but it has yet to be fixed.
@badco.3705
@badco.3705 Рік тому
Boku no pico 🤠
@mandelbro777
@mandelbro777 Рік тому
> "But can it run Crysis?"
@GaryExplains
@GaryExplains Рік тому
Crysis no... Doom yes!
@TheGamingDinosaurRoblox
@TheGamingDinosaurRoblox 9 місяців тому
of course its doom
@JarppaGuru
@JarppaGuru 2 місяці тому
16:06 yes yes no problem its not 16bit its 5bit haha
@tonysheerness2427
@tonysheerness2427 Рік тому
A little board consuming hours and hours of programmer's time.
@GaryExplains
@GaryExplains Рік тому
😂
@pathfinderpolska
@pathfinderpolska 6 місяців тому
Vega is shit. Iam from europe and we have rgb in composit and universal euroconnector 😊
@graealex
@graealex Рік тому
Yes, lets not use an SoC with a built-in framebuffer and digital video interface, and instead produce a 5-bit-per-channel analog legacy format for which display devices get increasingly rare by the day by bitbanging and having CPU utilization close to 100% all the time. Also, the severe shortages of all Raspberry Pi products means that you probably should avoid them altogether, at least if you have the option.
@GaryExplains
@GaryExplains Рік тому
Wow. Feel better now?
@graealex
@graealex Рік тому
@@GaryExplains Kind of. Anyway, there is so much interesting stuff to do - and we're here doing bad VGA on underpowered micros... Show some real-time HDMI pass-through video processing on an FPGA board, that'd be interesting.
@graealex
@graealex Рік тому
@@GaryExplains I also have the feeling that since Bitluni did not only VGA but also Composite video on an ESP32, the topic is about as explored as it can be.
@GaryExplains
@GaryExplains Рік тому
Hmmmm, I guess that depends on what you find interesting, personally I found this very interesting but I wouldn't find real-time HDMI pass-through video processing on an FPGA board interesting at all. Each to his own. The title is clear, as is the description, if the subject doesn't interest you then just move along. No need to rant about why you don't like it. Wastes my time and yours.
@GaryExplains
@GaryExplains Рік тому
I have no idea who Bitluni is (a UKpostsr I guess), and I don't make my videos based on what other people are making. I make what I find interesting. If you find it interesting as well, great. If not, then no problem.
@wakeupcanadians
@wakeupcanadians 8 місяців тому
what good is this video with nothing to how we can do this just you thumb down
@GaryExplains
@GaryExplains 8 місяців тому
Eh? I don't understand. What information is missing?
PicoMiteVGA: Raspberry Pi Pico Boot-to-BASIC Microcomputer
23:58
ExplainingComputers
Переглядів 120 тис.
1 класс vs 11 класс (рисунок)
00:37
БЕРТ
Переглядів 3,1 млн
I made a VGA card that blew my mind
15:44
bitluni
Переглядів 413 тис.
3 HACKING gadgets you have to TRY!!
19:34
NetworkChuck
Переглядів 1,4 млн
Turning a Raspberry Pi Pico into a GPU!
16:42
element14 presents
Переглядів 98 тис.
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
GreatScott!
Переглядів 580 тис.
Building a Raspberry Pi Pico Powered ZX Spectrum | #PiPico #zxspectrum
12:43
How VGA Works
16:23
Tech Tangents
Переглядів 114 тис.
I compared 3 modern ZX spectrum boards with PI Zero, PI PIco and ESP32 chips.
29:57