VGA/TV DAC using resistor arrays (and other uses)
Peter Jakacki
Posts: 10,193
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.
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.
Comments
Here are a few common values with uncommon results:
(2S+2P means 2 in series plus in series with 2 in parallel)
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
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.
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.
@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.
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.