Welcome to the Parallax Discussion Forums, sign-up to participate.

# VGA/TV DAC using resistor arrays (and other uses)

Posts: 5,281
edited August 2011
A long long time ago, somewhere in the deep recesses of the Propeller forum I posted a diagram of the arrangement that I use to create the video DACs using resistor arrays. Theres are normally made up of discrete resistors of various values that "should" be binary multiples of each other. I find that smd resistor arrays are costing me about half a cent each and they pack 4 resistors of the same value in the same "space" that a single 0805 resistor takes. At the time I implemented my DACs for the TV or VGA using the same pins and just used 470R resnets which seems to work quite well.

Here's what they look like (look to the bottom of the RJ45 socket):

For the purists however I present a similar implementation using three 240R resnets plus a single (or two) 560R resnet(s). Here's a schematic:

So why do it this way then? Well, the advantage is that you can just use the one or two values of resnets rather than all the individual values of resistors. It's also very compact as you can see from the photo. Plus this is a true binary DAC as the values increase in powers of 2.

There is a slight mismatch on the TV DAC which can be easily corrected if you want by just using another 560R resnet to get 280R or just put in a 33R resistor in series.

Is there any other advantage? Yes, using resnets in place of discrete resistors means that you can stock less values of resistors and instead make up values from combinations of the resistors in the resnet in the same space. Here's an example where we use a 240R resnet to get these odd values:

1) 60R using 4 in parallel
2) 80R using 3 in parallel with 1 spare
3) 120R using 2 in parallel with 2 spare
4) 240R using single elements with 3 spare
5) 320R using 1 in series with 3 in parallel
6) 360R using 1 in series with 2 in parallel with 1 spare
7) 480R using 2 in series with 2 spare
8) 600R using 2 in series with 2 in parallel
9) 720R using 3 in series with 1 spare
10) 960R using all 4 in series

So you can imagine that with as little as 3 values of resnets that you can span a wide range of values. Digikey sells reels of 5,000 for \$25, that's 20,000 resistors. So that's my little design tip for the day.
Brisbane, Australia
Tagged:

• Posts: 5,281
edited August 2011
Seeing nobody made any comments on this one I thought I would throw in a little bit more about using resnets in place of discrete resistors. I wrote a little program that spits out the values from all practical combinations not counting any spare elements left over. I chose values in the hundreds just to give an idea of the range of values obtainable. Did I leave any combinations out? Did I make any mistakes?

Here are a few common values with uncommon results:
(2S+2P means 2 in series plus in series with 2 in parallel)
```4 ELEMENT RESNET COMBINATIONS

RESNET  100
4P           25
3P           33
2P           50
1S           100
2S           200
3S           300
4S           400
1S+2P        150
1S+3P        133
2S+2P        250

RESNET  220
4P           55
3P           73
2P           110
1S           220
2S           440
3S           660
4S           880
1S+2P        330
1S+3P        293
2S+2P        550

RESNET  240
4P           60
3P           80
2P           120
1S           240
2S           480
3S           720
4S           960
1S+2P        360
1S+3P        320
2S+2P        600

RESNET  330
4P           82
3P           110
2P           165
1S           330
2S           660
3S           990
4S           1320
1S+2P        495
1S+3P        440
2S+2P        825

RESNET  470
4P           117
3P           156
2P           235
1S           470
2S           940
3S           1410
4S           1880
1S+2P        705
1S+3P        626
2S+2P        1175

RESNET  560
4P           140
3P           186
2P           280
1S           560
2S           1120
3S           1680
4S           2240
1S+2P        840
1S+3P        746
2S+2P        1400

RESNET  680
4P           170
3P           226
2P           340
1S           680
2S           1360
3S           2040
4S           2720
1S+2P        1020
1S+3P        906
2S+2P        1700
```
Brisbane, Australia
• Posts: 2,584
edited August 2011
Hi Peter

Good work. Nice to have someone pre-think these kind of things through. I think Phil Pilgrim once posted some info about the 430R resnets used on the propeller backpack.

I've been doing some work with 64 greyscale VGA, and one thing I noticed is the output resistance of the prop pin should be taken into account for small values of external R. I did some brief calcs and estimated the resistance at 27 ohms at 3v3, but haven't had a chance to characterise it properly (high/low logic level, Vdd supply voltage, temperature, shunt reactance, variation from prop to prop).

The good news about the 27 ohms is some white and blue leds can be directly driven, albeit with not great intensity matching, temperature independence, etc
• Posts: 5,281
edited August 2011
Thanks Tubular, I think my earlier posts predate even Phil's :)

The 27ohms source resistance you are seeing is probably close to the mark but since this is the MOSFET channel resistance when on I don't think you can quite count on any particular value like we can with fixed 1% resistors!

There is a trick to driving LEDs directly from a higher voltage that I have used in designs. Seeing that the LED has a forward voltage drop means you can drive your normal LEDs directly from the Prop I/O lines (through resistors) even if the LEDs are tied to +5V. So much more is the case for LEDs with higher voltage drops such as white and blue. If you have an LED with a 3V drop then you can certainly tie this to +5V and calculate your current limit based on 2V across the resistor.
Brisbane, Australia
• Posts: 48
edited August 2011
Another advantage of using resnets in place of discrete resistors is the reduction of the thermal coefficient ratio. Being packaged together the resistors see the same temp changes. When using the resnets as voltage dividers, the output is much more stable.
• Posts: 763
edited August 2011
Probably a silly question, but with the circuit in your schematic aren't you going to get crosstalk between HSync, Vsync and B via the TV output?
Pay for your free software - let the developers know how much you appreciate their work!

Links to Propeller stuff I've done (mostly composite video)
• Posts: 11,699
edited August 2011
I was going to ask the same question as eric. I see it forms a voltage divider of 1120R : 240R which is probably ok.

BTW from what I have asked, seems the 4th pin for TV is not used often, if at all. I have commandeered this pin for other uses.

I have pondered the connection of VGA/TV using sommon resistors. I was wondering if the VGA would suffer if 270R & 540R were used instead of 240R & 470R, or alternately would TV suffer if 240R, 480R & 960R were used instead??? This would make a simpler network.

The only issue with resnets is they are harder to hand solder due to the fine pitch. They are the most difficult part on my RamBlade.
My Prop boards:
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
• Posts: 5,281
edited August 2011
@ericball: Crosstalk? This circuit is used for either VGA or TV but not both at the same time. Any signals that appear to be cross-coupled are terminating back into low-impedance source pins (the Prop's I/O) and so are "swamped" from causing any interference. Sketch the paths (include the source/sink resistance of the Prop pins as well) and do the maths, you can see there is no problem.

@Cluso99: The VGA resistors will only affect the luminance of each of the primary colors and there is enough difference from monitor to monitor anyway so it shouldn't matter. The series resistors in the sync lines aren't really necessary but does protect the Prop. I'm using 470R resnets exclusively for both the VGA and TV and I can tell you that it just works.
Brisbane, Australia
• Posts: 11,699
edited August 2011
Thanks Peter.
My Prop boards:
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com
• Posts: 11,699
edited August 2011
Pondering a little further...

I can get this to 3 resnets, 2x 240R and 1x 470R. I think this would work. You will note I include an optional terminating resistor for TV of 191R-200R.

I have marked 3 links, but I think they could be permanently connected without problems. Just select the correct output in software.
My Prop boards:
Prop OS (also see Sphinx, PropDos, PropCmd, Spinix)
Website: www.clusos.com