I made a VGA card that blew my mind

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay you win you wanted VGA for the esp32 S3 you will get it and it's going to be awesome this video is sponsored by Isla a few years ago I made a VGA library and a few VGA boards for the esp32 many people loved it but I'm not a manufacturer and I sold only a limited account many things changed since then the esp32 API was updated a few times and since the esp32 S3 came out many people asked me to make a new version of the board since it wasn't compatible with my library anymore I decided it's time to give you what you want and this is how the esp32 S3 BGA was born let me take you on the journey how I try to squeeze out the maximum performance of the S3 capabilities and how I will fight back its flaws when I decided to make the new board a few weeks ago I wanted to make it more accessible the boards before required assembly and an extra depth board meanwhile I got enough practice to design one that has everything included it should be just plug and play without much soldering One requirement I wanted is that it's breadboard friendly so if you saw that on the headers you can put it on a breadboard and have extra two rows to access the pins the VGA connector is quite big and the antenna needs some clearance so this shape seems reasonable the core of all my VGA boards were the resistor leaders which converted the digital signals to analog RGB values I like to have it emphasized in the design so here are the regions where the color components are converted I ordered the Bots from Isla and then they arrived I was really excited gorgeous unfortunately I assumed the VGA connectors I have here were compatible with the footprint from kaikat the pins wouldn't match oh well it's the first version but then I remembered I got a few different connectors which are Monero these would barely fit with the pins but the board would overhang since there were no tracks in this area I decided to Simply Mill off a few millimeters [Music] [Music] hey yes problem solved nice [Music] a few moments later now that it's assembled I'm ready for some code until this point I didn't really take a look at the technical reference manual and once I did I realized why my old library wasn't working for the S3 espresso decided to remove the parallel I squared S Mode and make a new peripheral for cameras and LCDs it seems that the LCD peripheral can do up to 80 megahertz 8-bit and 40 megahertz 16 bit which is twice as fast as the esp32 was able to do with i squared s that could unlock 640x418 16 bit for us or maybe even 800 by 600 but on top of that the RGB mode has extra signals for hsync and v-sync this is amazing as a small recap these two signals indicate a new frame and the new line on the screen they are crucial and we had to sacrifice two of the precious bits of the frame buffer for that before so we were only able to implement 14-bit and 6-bit color video modes the generated signals also free up some of the system busts during the blank phases where no pixels are displayed and it also simplifies the implementation overall at least so I thought but more on that later my design was considering only 14-bit and would need an extra bit for green and blue to get the full potential but for now I could just start testing and just assigning some unused pins to the least significant bits of these color components the LCD peripheral has a generic driver that I could test I modified the example a bit and it actually worked [Music] currently I found the first blunder in the new peripheral it didn't support apll anymore that's the audio clock that we are using to generate any arbitrary pixel clock each VGA mode uses a specific clock and the apll was able to generate a clean one without any Jitter now we can pick 240 megahertz and divide it up only a clean fraction will give us two to three pixels TFT screen switch use the pixel clock to receive the data don't care about Jitter but our analog video unfortunately is that would be the target clock but you know what it's analog it might not matter if the clock is a little bit too fast or too slow as long it's Twitter free it will just not be perfect 60 hertz and this is the closest fraction of the clock and it turns out that most of the screens are actually quite tolerant testing that I also noticed that it even seems to support psram that means that the frame buffer can be completely an external RAM of the sp-32 that was also an option but the PS4 was too slow therefore we are always Limited in color Fidelity and resolution a frame of 640x480 in 8-bit would barely fit in SRAM before and now we could do that in 16-bit and try going even higher resolutions I had to test that and desolder the module and replaced it with one with two megabytes of PS Ram that I had in my lap actually worked nice nice however a bit of fact is that a 2 megabyte psrm version only supports quad SPI that's an SPI interface with four data lines to the memory it's fast but not fast enough for higher resolutions nothing this is where I found out that the modules from 8 megabyte upwards support octal SPI which is twice as fast unfortunately the 8 megabyte versions are rare locally I ordered some from AliExpress but that would take 10 days to arrive so I also ordered a Dev board with such a module locally that I could sacrifice when the devot arrived I did the heart transplant and was ready to test and it worked oh yes not only 640 by 480 but also 800 by 6 on it [Music] that was amazing it was way better than I expected but there's one thing I learned from the past testing on different devices and that's where I noticed sync issues what is that unfortunately three of my other screens seem to adjust the sync at the start of each frame okay that's not good that was a showstopper I thought it was the alignment of the V and h-sync signals but it turned out once I zoomed in on the scope there was a slight delay at each start of the frame I took a look in the impressive driver of the LCD peripheral and hidden underneath of several convoluted abstraction layers it became clear that each frame is sent individually and the transmission is just restarted after the frame is done there is no way to control the timing properly again an LCD wouldn't care but my analog screen which desperately tries to work with my signal does unfortunately the lower abstraction layers aren't exposed in the API so that meant that I had to steal as much coat as possible yeah I'm gonna go build my own private with Blackjack and circular buffers that also meant I had to take a dive in the technical reference manual again oh well I started with a simpler mode which wouldn't generate the sync signals it has a few problems to start but once it runs it's able to pump some bits the sync signals were once again in the frame buffer but I was able to finally get a clean continuous signal it was finally some success that I was able to share on the live stream look at this goodness ah come on this is awesome oh I love it and you know what we were even able to squeeze out 1280 by 720p and 8 bit what 723 VGA this is not noise this these are like super small squares yes it works it's Super Bowl already it's Super Bowl love it okay this is amazing and overshadows anything we were able to do before even added my old esp32 Ray Tracer for the test image that wasn't enough though I didn't want to clock the precious bus bandwidth with manual blank signals and wanted my full 8 and 16 bits it took me a day but it finally works oh nice it starts cleanly and we get up to 800 by 616 bits and 1024 by 768 in 8 Bits unfortunately at higher resolutions there seem to be issues with the peripheral that I couldn't identify yet 720p should work but the frame buffer is Shifting each frame that might need some manual hack but not today additionally some resolutions like 1080p are out of reach someone decided to give the total vertical lines attribute only 10 bits that limits to 1024 lines including the blank face and sync why also the h-sync is only limited to 7 bits while a few modes would require more oh well we have to work with what we got I'm happy about the 800 by 616 bits and I was even able to hack an out of spec 1024 by 768 and 16-bit at least on the analog screen ah what a fake mode this is so cool that is proof enough that the S3 VGA will work this is a 16-bit image but a 14-bit hardware so we still see some banding here it should be reduced with uh full 16 bits I added the additional bits and reorganized it a bit [Music] foreign [Music] this time I want to use Islas plugin to upload the project directly from here that has the advantage that I get the revisions automatically organized and even if I spot an error after ordering the boards I can still push a new version before the production started which actually happens more often than you think another feature that helps hiding rough edges from Mouse bytes when not using panels are the manual Bridges you just need to indicate the bridges using a 2.2 mil line on the edge cut layer [Music] foreign [Music] [Music] bus checks with the online viewer and we are ready for the new revision [Music] relax when ordering Bots from my style project is created automatically I just created a new folder named VGA here and moved the project there to have everything organized check out Isla for good and affordable pcbs from Europe they constantly work on new helpful tools with the coupon code Port Looney you get 5 Euros of your purchase you will find more information in the description and now I'm curious about the boards this arrived within one week awesome the guides worked flawlessly even my new connector footprint works to assemble the bot I'm using the new assembly guide from Isla it's quite useful to populate the boards quickly and the project is loaded I assigned the parts that were not found automatically then I switch to assembly and get a preview of the parts and their locations starting the guide it will show me where to place the parts grouped by type this is really handy as I don't have to check my PCB design on the PC to find all the locations for each path type since it's working with the browser I can use it from my tablet at a bench foreign [Music] foreign [Music] it's a novelty but it seems the second revision Works flawlessly full 16 bits increase the color Fidelity significantly here is a direct comparison the color bending is way less noticeable now [Music] the final spice I added and randomized the dithering now the color bending is completely gone this slight noise looks really organic I love it I hope you enjoyed these insights in a product development if you're curious for more please subscribe and consider supporting me on patreon PayPal or with a membership thanks for Isla for sponsoring me and big thanks to all my supporters your help makes a big difference I returned to some more coding now and I see you next time bye yeah ship it and claim on YouTube that is working this is so cool I like it I really love it
Info
Channel: bitluni
Views: 329,434
Rating: undefined out of 5
Keywords: maker, diy, tutorial, esp32, electronics, iot, tinkering, project, coding, arduino, platform io, atmel, microcontroller, vga, vesa, retro, DAC
Id: muuhgrige5Q
Channel Id: undefined
Length: 15min 43sec (943 seconds)
Published: Tue Jun 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.