# Building a VGA circuit

I am building an 8 bit VGA circuit and have 3 choices. One is to use a simple resistor network to convert digital to analog. The second is to use an op-amp. The third way to do this is to use a device like this CS4344. (This isn't suitable because of the frequency, but I am still looking for a low cost DAC.) I am looking for a cost effective but accurate way to do this. I know the pure resistor solution is probably the cheapest but the issue is it requires a lot of digital pins. However with a serial DAC I can use fewer pins. The data rate will be about 24Mhz at 30fps (it will be 640x480 resolution.) What is a good way to do this?

If I just use resistors in parallel, how do I impedance match for 75 ohm? Is this necessary or is it not needed?

• What are you driving it from? There are some PIC24 parts that have a nice set of 3 fast DACs built in for doing this. (PIC24FJ256DA206 - See store.hackaday.com/products/layerone-demoscene-board ) – pjc50 Jan 12 '16 at 10:18
• A spartan 6 FPGA – red car Jan 12 '16 at 10:23
• if I just use plain resistors is impendace mataching important? – red car Jan 12 '16 at 10:47
• @red-car I am not sure why would you need opamps, but if you want just some buffering, an emitter follower, with a 75 Ohm resistor in the emitter will do. – ilkhd Jan 12 '16 at 11:05
• Plain resistors will have a high (and varying!) output impedance, so you can't really match it. On the other hand for normal length VGA cables it shouldn't matter too much, it'll terminate at the far end. Is your 8 bit video RRRGGGBB or 8 bits per channel (24 bit) - the latter is going to be quite hard to get completely right with resistors only. – pjc50 Jan 12 '16 at 11:44

Just have a look in the Basys2 manual (p.8, Fig 13) how it is done there. (The Basys2 board is a starter kit for the Spartan 3):

For simple applications with only 3bits for R and G and 2bits for B a simple resistor network seems to be good enough.

BTW: I don't understand your concern about "require[ing] lot of digital pins" when your FPGA has probably more then hundred digital IOs.

• It depends on the package. Soldernig BGA at home for a project is not easy. – red car Jan 12 '16 at 13:32
• In that case I recommand to use a different package (if available) or a BGA breakout board that gives easy access to all pins. – Curd Jan 12 '16 at 14:20
• Doesnt it need to be terminated in 75 ohm? – red car Jan 13 '16 at 1:03
• @redcar - It will be terminated in 75 ohms at the monitor. – WhatRoughBeast Jan 13 '16 at 1:04
• @redcar: ideally yes, but it probably won't hurt if it is more. Maybe the signal edges won't be as clean as they could be but for an intensity resolution of max. 3bits per color it is good enough. – Curd Jan 13 '16 at 7:47

An external serial DAC is a monumentally bad proposition. The reason is I/O speed. At 24 MHz pixel rate, the DAC must be fed at a minimum $$f_{min} = 24 \text{ MHz} \times 8 = 192 \text{ MHz}$$ While the Spartan 6 is perfectly happy doing this, your external DACs (and you need 3 of them) will apparently be kluged in, and I don't like to think about how that will work.

• Yes. I agree. High-end DAC's are very expensive also. THe other is video encoders, but once agin the cost is a bit too steep for this application – red car Jan 13 '16 at 1:02