Hello everyone!

Does anyone know about VGA signals? I searched on the web and found some Arduino libraries to generate composite video with Arduino. Then, I found an interesting article about creating VGA images with PIC. Since, the microcontroller in case runs at 2MHz, while Arduino runs at 16MHz, I tought is plausible to generate that signal with Arduino.

I got some results:

1 – Both CRT and LCD monitors detect the signal

2 – Only the CRT shows something flicking on the screen

But, my problem is with timers. I am using the delay() and micros() function, but they aren't accurate enough. Does anyone know how to use interrupts and timers to create a better accurate signal?

Thanks!

Views: 530

Reply to This

Replies to This Discussion

Hi Marcelo,

try using the Arduino Timer 1 http://arduino.cc/playground/Code/Timer1 library. Different from the usual timer library, this one uses the 16-bit timer of atmega328. You can have a precision up to 0.0625uS.

Fernando

Almost there!

Yesterday I could keep a solid blue square on the screen for a few seconds, then it looses sync and come again few seconds later.

But as suggested, I had to use __asm__ and interrupt with timers.

Now, as a fried suggested, I will try the same code in an Arduino Mega, just to test the code and adjust with more precision.

Then, I will go back to UNO.

Hope to have good news soon!

 

Marcelo,

Did you check this link before? http://www.tinyvga.com/avr-vga

It's an Atmega16 based vga project...

Thanks Fenando. This will certainly help.

Today I generate the highest freq signal I could with Arduino: 4MHz.

I did this to make the VGA from the bottom. Now I know how far can I go with it.

I will post the code on the blog.

Very good! I am just trying to understand why she has chosen the ATmega324. Any idea?

I will keep my efforts to do the same but using the ATmega328, or more/less specificaly, the Arduino. :)

My wish is give the opportunity to anyone generate VGA signal using their own Arduinos.

(If nobody has done this yet)

Hey Marcelo, that's my project that HaD linked to, there. The reason I chose an ATmega324 is because:


1) It runs at 20Mhz, and has 10Mhz I/O bandwidth. You need speed to push pixels in VGA. The expected pixel rate is 25.175Mhz, but we can give up some resolution and run a little slower than that.

2) Wide I/O. Unless you generate all your pixels procedurally, you need video memory to render from. Reading memory fast enough to push pixels at VGA rates means you need parallel access to it, and the ATmega324 has a lot of I/O pins. For 8-bit VGA color at a reasonable resolution, you need 16 bit addresses and 8-bit data, for 24 pins total. Then you also need a few other pins for sync signals and such. The ATmega324 is the smallest AVR I know that can meet all these requirements.

The reason some slower chips like the Propeller can generate VGA is because they aren't doing it with the system clock and system I/O. They have special subsystems for the video driving. 

VC,

Thanks for the reply. Now I understood. As I am going forward on my trials with Arduino, more I understand your choice :) . But, I will keep trying with Arduino to see how far I can go.

Please, take a look at the blog post I have just made: http://garagelab.com/profiles/blogs/arduino-generated-vga-color-signal

Any comments are more than welcome.

Thank you!!!

RSS

Latest Activity

Profile Iconkaan and guner guvenc joined GarageLab (arduino, electronics, robotics, hacking)
Monday
Devang Rameshbhai Zalavadiya is now a member of GarageLab (arduino, electronics, robotics, hacking)
May 18
Profile Iconraj kumar, Raffaello Palandri and Jigga Boo joined GarageLab (arduino, electronics, robotics, hacking)
May 7
Profile IconGabriele D'Angelo, dale wolver, Ibrahim Aykut and 2 more joined GarageLab (arduino, electronics, robotics, hacking)
May 5
Profile IconJaschaSaurus Rex and Christian Mock joined GarageLab (arduino, electronics, robotics, hacking)
May 1
Igor Golov is now a member of GarageLab (arduino, electronics, robotics, hacking)
Apr 27
Marco is now a member of GarageLab (arduino, electronics, robotics, hacking)
Apr 24
Muhammad Ali commented on Marcelo Rodrigues's blog post Arduino generated VGA (color) signal - Complete!
"Thanks for the advice. I will persist with the code till I get it done. thanks once again."
Apr 18
Marcelo Rodrigues commented on Marcelo Rodrigues's blog post Arduino generated VGA (color) signal - Complete!
""The output waveforms on oscilloscope for Hsync and Vsync and for that matter RGB pins are not…"
Apr 17
Muhammad Ali commented on Marcelo Rodrigues's blog post Arduino generated VGA (color) signal - Complete!
"Hi  Marcelo I am trying to make this code work with Attiny 44a operating @ 20 MHz. I have…"
Apr 17
Profile IconReal NOiseux, Muhammad Ali, bob v and 1 more joined GarageLab (arduino, electronics, robotics, hacking)
Apr 17
baiqian is now a member of GarageLab (arduino, electronics, robotics, hacking)
Apr 10
Profile IconDavide and Almas Amandossov joined GarageLab (arduino, electronics, robotics, hacking)
Apr 6
Profile Iconvamoalrenga and John Ferrell joined GarageLab (arduino, electronics, robotics, hacking)
Apr 3
Marcelo Rodrigues replied to FiniousFingers's discussion New to group
"Yes, please share your progress here. Thanks and good"
Mar 27
FiniousFingers replied to FiniousFingers's discussion New to group
"Thanks, good to know someone is out there. I will be…"
Mar 27
Edward Evans replied to GarageLab's discussion Serious claims against BeagleBone's manufacturer CircuitCo
"Have you moved forward with any action?  I would be interested in discussing your…"
Mar 27
Marcelo Rodrigues replied to GarageLab's discussion Serious claims against BeagleBone's manufacturer CircuitCo
"Ed, No, they didn't deliver yet.  :( Good luck for us all."
Mar 23
Profile IconWesenachin Asfaw and Muhammad Basil joined GarageLab (arduino, electronics, robotics, hacking)
Mar 23
Marcelo Rodrigues replied to FiniousFingers's discussion New to group
"Hey man! A good point to start is reading basic tutorials on Arduino coding and wiring. Then, you…"
Mar 23

© 2017   Created by Marcelo Rodrigues.   Powered by

Badges  |  Report an Issue  |  Terms of Service