Shop OBEX P1 Docs P2 Docs Learn Events
Designing a VGA DAC for the Propeller — Parallax Forums

Designing a VGA DAC for the Propeller

MervinMervin Posts: 8
edited 2012-08-01 16:23 in Propeller 1
I want to do VGA generation on my propeller chip for one of my projects
and since I'm new to doing that kind of thing I'm having some trouble understanding some things.
I hope someone can help me out.

- I want to use 5 bits for each color channel (RGB15)
- The setup which I would like to use is: Propeller --> 2x 8bit shift register --> Transistors --> R2R Ladder --> VGA Port (640x480 @ 30 Hz or lower if possible, 60 would be overkill)

I've looked at some examples and I've tested some things in simulation software but I can't quite figure out which resistor values to use for the R2R ladder to get a 5bit range at vcc 3.3v from 0v to 0.7v
Some examples seem to conflict with eachother even.

Sources I used:
http://www.avr-asm-tutorial.net/avr_en/AVR_DAC.html
http://www.brischalle.de/JDAC/DAC_R2R_network_calculation_en.html


My circuit:
dac_id_test.PNG
737 x 535 - 21K

Comments

  • TubularTubular Posts: 4,703
    edited 2012-07-31 11:53
    Mervin,

    Firstly a big Hello and Welcome.

    Please have a look at this thread were I run through the calculations for a 6 bit DAC out of the prop, for Greyscale operation
    http://forums.parallax.com/showthread.php?131622-Resistor-values-for-64-GreyScale-VGA-output-from-the-Propeller

    Towards the bottom of the thread Lawson uses R2R networks - 91 ohms and 160 ohms are suggested because the 27 ohm driving resistance of the prop pin drivers.

    What kind of resolution are you hoping to achieve? Remember the hub ram (where the video buffer is) is 32kB, and you need to leave some space for your program.
  • MervinMervin Posts: 8
    edited 2012-07-31 14:27
    Thanks for welcoming me Tubular,

    I'm reading your thread on my other monitor as I'm typing this:
    I'm hoping to achieve a resolution of 640x480 @ at least 24hz with 5 bits resolution per color channel. (RRRRRGGGGGBBBBB) colors will be stored in several 256 color palettes in the main RAM and the framebuffer will be stored in an external RAM chip.

    Thanks for the information and the formulas I'm sure this will get me going :)
  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-31 14:47
    It will be very difficult to get the frame buffer to reside in external RAM. The video rate is marginal at that resolution or higher even with the use of the internal RAM for the frame buffer and the overhead for referencing external RAM is significant. Look at the Mikronauts website for one example of a video buffer in external RAM.
  • MervinMervin Posts: 8
    edited 2012-08-01 13:38
    Thanks for your input! I did not consider that with such detail. Where on the Mikronauts website can I find the article?.
    With evertyhing under consideration and with the number of free pins which I have left shrinking rapidly I have chosen to use the RRGGBBII palette with 2 video modes available: 256x240@24Hz and 480x270@30Hz

    I have designed the following R2R DAC (repeat for each color channel):
    adcnew.png


    (the 27 Ohm resistors and switches represent the Propeller outputs)

    I'm still having a lot of trouble figuring out how to control the 2 intensity bits of all 3 channels (R,G,B) at the same time from 2 propeller pins,
    I would love to get some info on how to tackle that problem.
    785 x 429 - 25K
  • MervinMervin Posts: 8
    edited 2012-08-01 14:28
    I've looked at the threads but they don't seem to describe an R2R solution, In the meantime I'll simulate some more things.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-08-01 14:30
    Be aware that in the RRGGBBII method, the II outputs do not control the RGB gains by multiplication but, rather, add equally to all of them. This has the effect of diluting the saturation. The resulting color gamut is not necessarily bad, though, especially when continuous-tone photos are being displayed. But it may not be optimal for highly-saturated color graphics.

    -Phil
  • TubularTubular Posts: 4,703
    edited 2012-08-01 16:23
    Don't get too hung up on R2R vs the alternatives. The advantages of R2R are fewer component values (though more resistors in total), and perhaps better immunity to out of tolerance resistances.

    With your simulations don't forget to terminate the outputs via a 75 ohms resistor to simulate the monitor load to make them give you your 0.7v peak.
Sign In or Register to comment.