Arduino generated VGA (color) signal - Complete!

Hey guys,

By the picture above we can notice that the problem with the black area was solved, and now, the entire screen is filled, so we can print on any corner (640x480 @ 60Hz). The problem was the interrupt function, the time of calling and returning was taking so much time for an ATmega328, I replace the functio call for an "if", checking the timer register all the time. When the timer gets a defined value (31.3KHz), the "if condition" is true and the line is printed. This way the program is not wasting time calling and coming back from the interrupt function.

Another problem was that only CRT monitors were understanding my signal. The problem was the voltage level, now I am using a resistor in series with a diode for R, B and G, forcing my TTL (5V) signal to become 0.7V, as VGA standards says, and any VGA monitor (including LCD and LEDs) can print the signal.

So, everything is solved now, and we can generate color VGA sinal.

Now, I will try to create a library intelligent enough to design shapes and letters, and maybe generate more colors.

Everything using just an Arduino UNO. :))

Here is the code I wrote. Enjoy! We are here to share.

http://pastebin.com/F5Gnewm8

If you are going to try this, you must know this too:

And this:

"VGA industry standard" 640x480 pixel mode

General characteristics

Clock frequency 25.175 MHz
Line frequency 31469 Hz
Field frequency 59.94 Hz

One line

8 pixels front porch
96 pixels horizontal sync
40 pixels back porch
8 pixels left border
640 pixels video
8 pixels right border
---
800 pixels total per line

One field

2 lines front porch
2 lines vertical sync
25 lines back porch
8 lines top border
480 lines video
8 lines bottom border
---
525 lines total per field 

Be aware of turning your RGB signal off when sync pulsing.
And open your eyes for what the compiler is doing (or trying to do) when reading your code. A lot of time is wasted in many situations, and the non-repetitive ones are the most dangerous.

If your signal is not in perfect sync, the monitor will reject your signal.

Use the osciloscope to monitor all this things. 

Good luck and count on me if you need help!

Views: 45308

Comment by Marcelo Rodrigues on April 4, 2012 at 3:11pm

Guys,

The code was wrong because Ning had cut some characters, so I change it to a link: http://pastebin.com/F5Gnewm8

Now it is ok. :)

Enjoy!

Comment by Simon Schvartzman on July 27, 2012 at 10:51am
Marcelo, Congratulations, this is really awesome!

Have you made any progress with the library? I would really like to try the whole stuff..

Best! Simon
Comment by Marcelo Rodrigues on July 27, 2012 at 11:21am

Hello Simon!

Thank you! Yes, Ive made some progress. Take a look at the images bellow:

With the same code (few adaptations) I could print images in a TFT LCD too:

Unfortunatly, I didn't have time to write the library yet. As soon as I do it I will post here. But the max quality (pixels) I could do with VGA was like the image above. 

The TFT is still slow. We can see a line running on the screen. But putting the entire image in the flash memory it become fast enough for a good image.

Soon I post more info. Ok?

Comment by Simon Schvartzman on July 27, 2012 at 11:59am
Thanks for your prompt answer. Well done job!

Any hint regarding the best/cheapest way to connect an Arduino to an HDMI enabled monitor/Tv? Just to show text and simple graphics...
Comment by Marcelo Rodrigues on July 27, 2012 at 1:19pm

Simon,

Take a look at this: http://www.andrewncarr.com/hdmi/index.html

Does it help?

:)

Comment by Simon Schvartzman on July 28, 2012 at 8:47am
Marcelo, thanks again for getting back to me. Unfortunatky this is not really what I'm looking for. The HDMI CEC let's you control a device but I want to use the monitor as the output device for the Arduino. I other words I want to use a Monitor instead od an LCD display as the output device.. Anyway many thanks...will keep searching (I have seen some solutions by connecting an Arduino to a Rapsbery PI)
Comment by Marcelo Rodrigues on July 30, 2012 at 7:19am

MMmmmmm... I understood. This is a very interesting chalenge. 

Keep us informed about your progress. I will try to make some research here too, maybe I can help.

Good luck!

Comment by Mark Lewental on August 29, 2012 at 6:29am

Marcelo,

Awesome!  I'm interested in trying what you've done and was wondering if you had posted a schematic for DB15 interface to the Arduino.  Many thanks!

Comment by Marcelo Rodrigues on August 29, 2012 at 7:04am

Mark,

I will find time to design it using Eagle. Until there, take a look at the table in the beggining of this post, there you will find the pins names. You could connect it directly to the Arduino, but the problem is the RGB signal must be 0.7V, so you have to reduce the voltage level from 5V to 0.7V. You can do this using 2 resistors as resistive  dividers.

Let me know if you still have questions. :)

Good luck!

Comment by Mark Lewental on August 29, 2012 at 7:59am

Marcelo,

Thank you for the fast response!  I noticed in your pictures you used diodes as well as resistors.  Any specific ones?  Thanks again!!!

Mark

Comment

You need to be a member of GarageLab (arduino, electronics, robotics, hacking) to add comments!

Join GarageLab (arduino, electronics, robotics, hacking)

Latest Activity

Profile IconMarc Stevens, Rafael Caballos, Sobhan kumar vellanki and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Friday
Profile IconEmma Junge and Halil Birtan joined GarageLab (arduino, electronics, robotics, hacking)
Wednesday
m fluer is now a member of GarageLab (arduino, electronics, robotics, hacking)
May 21
Craig P. Summers commented on GarageLab's blog post A Robot Controlling a Switch
"True automation is becoming more frequent in todays life as automated home helps home homeowners in…"
May 21
Profile Icongeorge villaflor, Steve Kotlowski, John McClure and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
May 20
Anthony M. Hagy commented on GarageLab's blog post Project Sunroof
"Great project idea. The roof is an important part of home, roof contractor plays an important role…"
May 20
Anthony M. Hagy commented on GarageLab's blog post Apple Aims to Test Self-Driving Cars at Military Base
"Nice Post. Thank you for sharing."
May 20
Profile IconMarcus Ataide, abdelrahman taher, Anthony M. Hagy and 4 more joined GarageLab (arduino, electronics, robotics, hacking)
May 16
Profile IconKeshava DEv, bryan mcfadden and babbelkwebbel joined GarageLab (arduino, electronics, robotics, hacking)
May 9
Rosa Yu is now a member of GarageLab (arduino, electronics, robotics, hacking)
May 6
Profile IconMarvin Wright and chaudhari vipin vasudev joined GarageLab (arduino, electronics, robotics, hacking)
May 4
Marcelo Rodrigues replied to Peter Davies's discussion Anyone got stock of Garagelabs automation board
"Peter, I will talk them to check if they can produce more units and make available on their…"
May 3
Brian B. Feaster commented on GarageLab's blog post Information Trade Between Cars by Wi-Fi
"I like this idea of information trade between cars by the WI-Fi . This would contribute in reducing…"
May 2
Peter Davies replied to Peter Davies's discussion Anyone got stock of Garagelabs automation board
"Hi Marcello I have bought all of Seeeds stock in two purchases - 8 units in all.  When I asked…"
May 2
Profile Icontarun patel, Enrique S. Perez Rodriguez, K Fiore and 5 more joined GarageLab (arduino, electronics, robotics, hacking)
May 2
Marcelo Rodrigues replied to Peter Davies's discussion Anyone got stock of Garagelabs automation board
"Peter, You can buy them on…"
May 2
Rob Lambert joined Marcelo Rodrigues's group
Thumbnail

Arduino

Group for the Arduino communitySee More
Apr 30
Sardar Tamoor commented on Thulana Vimukthi's blog post GPS GUIDED AUTONOMOUS ROBOT
"can you plz help me on my project !!! its basically obstacle avoidance in dynamic environment and…"
Apr 27
Sardar Tamoor commented on Thulana Vimukthi's blog post GPS GUIDED AUTONOMOUS ROBOT
"can you plz help me on my project !!! its basically obstacle avoidance in dynamic environment and…"
Apr 27
Sardar Tamoor is now a member of GarageLab (arduino, electronics, robotics, hacking)
Apr 26

© 2016   Created by Marcelo Rodrigues.   Powered by

Badges  |  Report an Issue  |  Terms of Service