[TUT][ASM][HARD] How to Make VGA with any AVR

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Greets fellow Freaks!

There have been several requests on an instructional showing how to make an AVR output a VGA signal. I have started such a tutorial, and plan to have it completed by the end of this week...

http://www.lucidscience.com/pro-...

The project will show how to make 3 different VGA generators...

1) A basic real time bit banger (done)
2) A small internal frame buffer (started)
3) A full blown dual buffer system with external SRAM

I am using an ATMega324 and 644p, but this is really just a DIY to show how it can be done with any micro controller.

Source codes are included, but they are quick hacks, leaving much room for improvement.

Comments/suggestions are always welcome.
Hope to have this completed by the weekend!

Cheers.
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

Last Edited: Thu. Nov 4, 2010 - 07:57 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is great man, thanks a lot for the link

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Respect for all the effort and such a nice and fluent tutorial.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brad, this shouldn't be allowed to drop off the first page of AVR Forum (as will eventually happen). Can I move this to the Tutorial Forum?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Brad, this shouldn't be allowed to drop off the first page of AVR Forum (as will eventually happen). Can I move this to the Tutorial Forum?

Thanks!

Yes, you can take any of my AVR projects from LucidScience and link them here anytime. Being a "FanBoy", I plan to have hundreds of cool AVR projects on my site as the years roll by.

Now I best get busy on my next day off and complete this VGA tutorial, as the best part is yet to come.

Cheers,
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Finally had a day off to complete this project, and added 16 new pages of information...

http://www.lucidscience.com/pro-...

Hope someone finds this useful, it was sure fun to make!

Cheers.
Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a question for Atomic Zombie about another generator circuit I found. Should I PM you or make a post in the appropriate forum?

Edit: I'm going to go ahead and post the question in the AVRFreaks Academy forum as I just realized what I have a question about is in the projects section. It's the Deogen project.

Thanks,

Eric

P.S. Everytime I try to click the smilie button I get a popup window that says "Hacking attempt 1"

[moderator: been like that for 2, maybe 3 years, if Atmel can grub together three shekels to put in the meter I guess it may be fixed one day ;-)]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi. As far as i know, you need an S-Video output on your graphics card and a stereo output from a sound card. There is no way you can adapt a signal from a VGA port cell phone spy to do what you want.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I followed this tutorial with no issues barring one problem that Brad mentions at the beginning:

 

"Newer LCD monitors will work just fine, but there may be a slight "banding" effect on horizontal lines if you cannot adjust a setting called "pixel" clock."

 

I'm using an LCD monitor and I seem to be plagued with this issue. I've tried it on at least 3 LCD monitors with the same issue as quoted above. I've included a screen shot of this banding that I'm getting. Reading into it some people say the VGA signal needs to be latched with the pixel clock to align the data. I'm doing this with 7400 IC chips and I still have an issue. Is there anyway to get rid of this banding issue? Or is it something that some LCD monitors have issues with?

 

Looking at what other people have done with AVRs and looking at their screen shots and videos it looks like most people do not suffer from this. I'm I missing some vital thing that needs to be done.

 

And thank you to anyone that helps :)

 

Edit: The image should show solid red and green and not the light to dark banding that is going on.

 

 

Attachment(s): 

Last Edited: Wed. Dec 25, 2019 - 09:53 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After playing around with this more, I have concluded that it's to do with monitors not reacting correctly with hacked VGA modes.

 

Brads tutorial hacks the VGA timings for 640x480 at 60fps to a size of 512x480 by swapping in a 20mhz clock for a 25.175mhz clock. Then he fudges the 508 width to 512 by taking width away from the porches. Cheap LCD monitors cannot cope with this and banding occurs. What I did was change the video to a 800x600 at 60fps screen size using a 20mhz clock which gives a size of 400x600. All my LCD monitors now work correctly with no banding. 20mhz is an exact half of 40mhz so I guess the timings are fine for LCD monitors.

 

So I think you have to be wary on how you hack the VGA timings to get a proper image. Probably all these hacked modes would work on CRT monitors with no issues.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I guess LCDs have a "digital scanning emulation" or something like that, instead of actual analog scanning like the CRTs, so they don't cope well if the timing is not precise.

I found this table and you are right, 800x600 has a 40MHz pixel rate so it's a better match if the MCU runs @20MHz.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Andy201 wrote:
I'm doing this with 7400 IC chips ...
Likewise by Brad

Radical Brad Hacks – Vulcan-74 | AtomicZombie DIY Plans

Andy201 wrote:
Looking at what other people have done with AVRs ...
XMEGA384C3 by Brad

XMega cranks out NTSC color and digital stereo sound! | AVR Freaks

though, IIRC, there's more than one thread on that.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Great links :) Yep, Brad explains the banding in the NTSC thread. Here's what he wrote about it:

 

"So my 1600x1200 monitor is fine when showing 800x600 or 400x300, but when displaying something like 640x480 or 320x240, there is a slight banding as the pixel clock is "fudged" by the internal display processor in the monitor. Since I am much too insane to tolerate such glitches in my projects"