Go Down

Topic: Simulating VGA Signal (Read 4 times) previous topic - next topic


dwan, perhaps I am missing something, but it looks like your sketch  is a sync generator but does not generate visible video. I wonder if Lt. Waffles can use your code as a framework and add in the display functionality from the code in westfw's link. What do you think?

BTW, does the millis interrupt on timer0 affected the sync pulse accuracy?


Dec 03, 2008, 12:55 pm Last Edit: Dec 03, 2008, 01:05 pm by dwan Reason: 1
You're right, it only outputs sync signals. Nonetheless, it should be easy to obtain a steady color with minor modifications.

My code is only a stripped-down version of Max Ibragimov's, so it should be ok to display more complex things, if you can understand all Ibragimov's work (that's not my case :) ). I only took what i needed and understood from his code, given it's not exactly Arduino code and i'm not a skilled coder.

Concerning the accuracy of the sync signal, there is a bit of horizontal jitter. It could be caused by Timer0, i did not tried to stop it. Sometimes the sync is very steady, sometimes it jitters. Actually, i'm trying to cram in the arduino the TLC540 library from acleone, which uses Timer1 & 2 with my code snippet, which I modified to use Timer0. Sadly, i also need a serial link. Each time the arduino receives data, it breaks the VGA sync. For now, i only plan to use 2 168's (one for the sync and the other for serial and TLC stuff), as it only add a few euros to the price of my project.


Dec 03, 2008, 01:37 pm Last Edit: Dec 03, 2008, 01:39 pm by mem Reason: 1
The code in westfw's link handles the serial port just after the vertical sync pulse and before the first visible line so incoming serial data shouldn't affect the display. But that means that the Arduino serial handler has to be disabled and replaced.

After disabling the millis timer and the Serial interrupt handler and using directo port io, there would not be much left of the arduino core code.


Dec 03, 2008, 01:47 pm Last Edit: Dec 03, 2008, 01:48 pm by dwan Reason: 1
Right, that's why i'm looking towards C programming. By handling serial in a non-arduino style, do we lose any critical feature of the arduino?


Dec 03, 2008, 01:56 pm Last Edit: Dec 03, 2008, 01:57 pm by mem Reason: 1
By handling serial in a non-arduino style, do we lose any critical feature of the arduino?

If you use the approach in wesfw's link you lose the Arduino Serial runtime support
My guess is that implementing a vga driver to the OP's requirements would eliminate most of the Arduino functionality. You could use the arduino IDE to create and download the code, but I would think that the running code would not have access to any of the Arduino specific input/output or time functions.

Go Up